├── components ├── esp-face │ ├── image_util │ │ └── component.mk │ ├── docs │ │ ├── en │ │ │ ├── get-started │ │ │ │ └── README.md │ │ │ └── api-reference │ │ │ │ ├── README.md │ │ │ │ └── mtmn │ │ │ │ ├── html │ │ │ │ ├── graph_legend.md5 │ │ │ │ ├── mtmn_8h__incl.md5 │ │ │ │ ├── face__detection__forward_8h__incl.md5 │ │ │ │ ├── doc.png │ │ │ │ ├── bc_s.png │ │ │ │ ├── bdwn.png │ │ │ │ ├── closed.png │ │ │ │ ├── nav_f.png │ │ │ │ ├── nav_g.png │ │ │ │ ├── nav_h.png │ │ │ │ ├── open.png │ │ │ │ ├── tab_a.png │ │ │ │ ├── tab_b.png │ │ │ │ ├── tab_h.png │ │ │ │ ├── tab_s.png │ │ │ │ ├── doxygen.png │ │ │ │ ├── splitbar.png │ │ │ │ ├── sync_off.png │ │ │ │ ├── sync_on.png │ │ │ │ ├── arrowdown.png │ │ │ │ ├── arrowright.png │ │ │ │ ├── folderopen.png │ │ │ │ ├── folderclosed.png │ │ │ │ ├── graph_legend.png │ │ │ │ ├── mtmn_8h__incl.png │ │ │ │ ├── face__detection__forward_8h__incl.png │ │ │ │ ├── mtmn_8h__incl.map │ │ │ │ ├── face__detection__forward_8h__incl.map │ │ │ │ ├── index.hhp │ │ │ │ ├── tabs.css │ │ │ │ ├── index.html │ │ │ │ ├── globals_enum.html │ │ │ │ ├── globals_defs.html │ │ │ │ ├── globals_eval.html │ │ │ │ ├── dir_f92cccad4fdd005aca3e808d97427089.html │ │ │ │ ├── annotated.html │ │ │ │ ├── globals_func.html │ │ │ │ ├── dir_b1c38619a7f75ea3a62b0ffb4d1217b3.html │ │ │ │ ├── classes.html │ │ │ │ ├── dir_192612bb567615e1828468f80da02f9d.html │ │ │ │ ├── functions_vars.html │ │ │ │ ├── functions.html │ │ │ │ ├── globals.html │ │ │ │ ├── files.html │ │ │ │ ├── structmtmn__net__t.html │ │ │ │ ├── face__detection__forward_8h.html │ │ │ │ └── index.hhk │ │ │ │ └── latex │ │ │ │ ├── mtmn_8h__incl.md5 │ │ │ │ ├── face__detection__forward_8h__incl.md5 │ │ │ │ ├── mtmn_8h__incl.pdf │ │ │ │ ├── face__detection__forward_8h__incl.pdf │ │ │ │ ├── annotated.tex │ │ │ │ ├── files.tex │ │ │ │ ├── Makefile │ │ │ │ ├── dir_f92cccad4fdd005aca3e808d97427089.tex │ │ │ │ ├── dir_b1c38619a7f75ea3a62b0ffb4d1217b3.tex │ │ │ │ ├── dir_192612bb567615e1828468f80da02f9d.tex │ │ │ │ ├── structmtmn__net__t.tex │ │ │ │ ├── face__detection__forward_8h.tex │ │ │ │ ├── structnet__config__t.tex │ │ │ │ └── refman.tex │ │ └── zh_CN │ │ │ ├── api-reference │ │ │ └── README.md │ │ │ └── get-started │ │ │ └── README.md │ ├── face_detection │ │ ├── component.mk │ │ └── include │ │ │ └── fd_forward.h │ ├── face_recognition │ │ ├── component.mk │ │ ├── Kconfig │ │ ├── include │ │ │ ├── fr_flash.h │ │ │ └── fr_forward.h │ │ └── fr_flash.c │ ├── lib │ │ ├── libfrmn.a │ │ ├── libmtmn.a │ │ ├── libdl_lib.a │ │ ├── mkmodel_linux │ │ ├── mkmodel_macos │ │ ├── mkmodel_windows │ │ ├── libfd_coefficients.a │ │ ├── libfr_coefficients.a │ │ ├── component.mk │ │ └── include │ │ │ ├── frmn.h │ │ │ ├── dl_lib_coefgetter_if.h │ │ │ ├── mtmn.h │ │ │ └── dl_lib_matrix3dq.h │ ├── .gitignore │ ├── main │ │ ├── component.mk │ │ ├── main.c │ │ └── Kconfig │ ├── Makefile │ ├── CHANGELOG.md │ └── LICENSE ├── fb_gfx │ ├── component.mk │ ├── CMakeLists.txt │ ├── include │ │ └── fb_gfx.h │ └── fb_gfx.c ├── recorder_engine │ ├── libnn_model.a │ ├── libesp_wakenet.a │ ├── component.mk │ └── include │ │ ├── esp_sr_models.h │ │ └── esp_sr_iface.h ├── esp32-camera │ ├── driver │ │ ├── private_include │ │ │ ├── xclk.h │ │ │ ├── sccb.h │ │ │ ├── camera_common.h │ │ │ └── twi.h │ │ ├── sensor.c │ │ ├── xclk.c │ │ ├── sccb.c │ │ └── include │ │ │ └── sensor.h │ ├── component.mk │ ├── Kconfig │ ├── sensors │ │ └── private_include │ │ │ ├── ov2640.h │ │ │ └── ov7725.h │ ├── CMakeLists.txt │ └── conversions │ │ ├── private_include │ │ ├── yuv.h │ │ └── jpge.h │ │ ├── include │ │ ├── esp_jpg_decode.h │ │ └── img_converters.h │ │ └── esp_jpg_decode.c └── component_conf.mk ├── .vscode └── settings.json ├── main ├── build │ └── CMakeFiles │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── 3.11.1 │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ ├── CMakeRCCompiler.cmake │ │ ├── CMakeSystem.cmake │ │ ├── CMakeCCompiler.cmake │ │ └── CMakeCXXCompiler.cmake │ │ └── feature_tests.c ├── CMakeLists.txt ├── component.mk ├── include │ ├── app_httpd.h │ ├── app_wifi.h │ └── app_camera.h ├── app_main.c ├── app_camera.c ├── Kconfig.projbuild └── app_wifi.c ├── partitions.csv ├── .gitmodules ├── CMakeLists.txt ├── Makefile ├── .gitignore ├── LICENSE ├── README.md └── sdkconfig.defaults /components/esp-face/image_util/component.mk: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/get-started/README.md: -------------------------------------------------------------------------------- 1 | # Coming soon 2 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/README.md: -------------------------------------------------------------------------------- 1 | # Coming soon 2 | -------------------------------------------------------------------------------- /components/esp-face/docs/zh_CN/api-reference/README.md: -------------------------------------------------------------------------------- 1 | # Coming soon 2 | -------------------------------------------------------------------------------- /components/esp-face/docs/zh_CN/get-started/README.md: -------------------------------------------------------------------------------- 1 | # Coming soon 2 | -------------------------------------------------------------------------------- /components/fb_gfx/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := include 2 | COMPONENT_SRCDIRS := . 3 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/graph_legend.md5: -------------------------------------------------------------------------------- 1 | 387ff8eb65306fa251338d3c9bd7bfff -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/mtmn_8h__incl.md5: -------------------------------------------------------------------------------- 1 | 94d70215506c130180d1cd070f7ea893 -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/mtmn_8h__incl.md5: -------------------------------------------------------------------------------- 1 | 9a690a3964c9e0b7780b30643d71dd8c -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.default.configurationProvider": "vector-of-bool.cmake-tools" 3 | } -------------------------------------------------------------------------------- /components/esp-face/face_detection/component.mk: -------------------------------------------------------------------------------- 1 | #Component makefile 2 | 3 | COMPONENT_ADD_INCLUDEDIRS := include 4 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/face__detection__forward_8h__incl.md5: -------------------------------------------------------------------------------- 1 | 6af43216b2acf2b63a655cb6bef99878 -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/face__detection__forward_8h__incl.md5: -------------------------------------------------------------------------------- 1 | a42e65cf9af8578d43249de8f416cf82 -------------------------------------------------------------------------------- /components/esp-face/face_recognition/component.mk: -------------------------------------------------------------------------------- 1 | #Component makefile 2 | 3 | COMPONENT_ADD_INCLUDEDIRS := include 4 | -------------------------------------------------------------------------------- /main/build/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /components/esp-face/lib/libfrmn.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/lib/libfrmn.a -------------------------------------------------------------------------------- /components/esp-face/lib/libmtmn.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/lib/libmtmn.a -------------------------------------------------------------------------------- /components/esp-face/lib/libdl_lib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/lib/libdl_lib.a -------------------------------------------------------------------------------- /components/esp-face/lib/mkmodel_linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/lib/mkmodel_linux -------------------------------------------------------------------------------- /components/esp-face/lib/mkmodel_macos: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/lib/mkmodel_macos -------------------------------------------------------------------------------- /components/esp-face/lib/mkmodel_windows: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/lib/mkmodel_windows -------------------------------------------------------------------------------- /main/build/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/main/build/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /components/recorder_engine/libnn_model.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/recorder_engine/libnn_model.a -------------------------------------------------------------------------------- /components/esp-face/lib/libfd_coefficients.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/lib/libfd_coefficients.a -------------------------------------------------------------------------------- /components/esp-face/lib/libfr_coefficients.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/lib/libfr_coefficients.a -------------------------------------------------------------------------------- /components/recorder_engine/libesp_wakenet.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/recorder_engine/libesp_wakenet.a -------------------------------------------------------------------------------- /components/esp-face/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | sdkconfig 4 | sdkconfig.old 5 | 6 | pnet_model.* 7 | rnet_model.* 8 | onet_model.* 9 | frmn_model.* 10 | -------------------------------------------------------------------------------- /partitions.csv: -------------------------------------------------------------------------------- 1 | # Espressif ESP32 Partition Table 2 | # Name, Type, SubType, Offset, Size 3 | factory, app, factory, 0x010000, 3M 4 | nvs, data, nvs, 0x310000, 16K 5 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/doc.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/bc_s.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/bdwn.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/closed.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/nav_f.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/nav_g.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/nav_h.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/open.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/tab_a.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/tab_b.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/tab_h.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/tab_s.png -------------------------------------------------------------------------------- /main/build/CMakeFiles/3.11.1/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/main/build/CMakeFiles/3.11.1/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /main/build/CMakeFiles/3.11.1/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/main/build/CMakeFiles/3.11.1/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/doxygen.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/splitbar.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/sync_off.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/sync_on.png -------------------------------------------------------------------------------- /components/esp32-camera/driver/private_include/xclk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "camera_common.h" 4 | 5 | esp_err_t camera_enable_out_clock(); 6 | 7 | void camera_disable_out_clock(); 8 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/arrowdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/arrowdown.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/arrowright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/arrowright.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/folderopen.png -------------------------------------------------------------------------------- /components/esp-face/main/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # "main" pseudo-component makefile. 3 | # 4 | # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) 5 | 6 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/folderclosed.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/graph_legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/graph_legend.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/mtmn_8h__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/mtmn_8h__incl.png -------------------------------------------------------------------------------- /main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | set(COMPONENT_SRCS "app_main.c" "app_wifi.c" "app_camera.c" "app_httpd.c") 4 | set(COMPONENT_ADD_INCLUDEDIRS "include") 5 | register_component() -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/mtmn_8h__incl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/latex/mtmn_8h__incl.pdf -------------------------------------------------------------------------------- /components/fb_gfx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(COMPONENT_SRCS "fb_gfx.c") 2 | set(COMPONENT_ADD_INCLUDEDIRS "include") 3 | set(COMPONENT_PRIV_INCLUDEDIRS "") 4 | set(COMPONENT_PRIV_REQUIRES newlib) 5 | register_component() -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "esp-idf"] 2 | path = esp-idf 3 | url = https://github.com/espressif/esp-idf 4 | [submodule "components/esp-face"] 5 | path = components/esp-face 6 | url = https://github.com/espressif/esp-face 7 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/face__detection__forward_8h__incl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/html/face__detection__forward_8h__incl.png -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/face__detection__forward_8h__incl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/botofancalin/esp32_idf_camera_app/HEAD/components/esp-face/docs/en/api-reference/mtmn/latex/face__detection__forward_8h__incl.pdf -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 5 | project(esp32_idf_camera_app) 6 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/mtmn_8h__incl.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /components/esp32-camera/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := driver/include conversions/include 2 | COMPONENT_PRIV_INCLUDEDIRS := driver/private_include conversions/private_include sensors/private_include 3 | COMPONENT_SRCDIRS := driver conversions sensors 4 | CXXFLAGS += -fno-rtti 5 | -------------------------------------------------------------------------------- /main/build/CMakeFiles/3.11.1/CMakeRCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_RC_COMPILER "C:/msys32/usr/bin/windres.exe") 2 | set(CMAKE_RC_COMPILER_ARG1 "") 3 | set(CMAKE_RC_COMPILER_LOADED 1) 4 | set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC) 5 | set(CMAKE_RC_OUTPUT_EXTENSION .obj) 6 | set(CMAKE_RC_COMPILER_ENV_VAR "RC") 7 | -------------------------------------------------------------------------------- /components/esp-face/face_recognition/Kconfig: -------------------------------------------------------------------------------- 1 | choice CONV_IMPL 2 | bool "Convolution Implementation" 3 | default XTENSA_IMPL 4 | 5 | config C_IMPL 6 | bool "ANSI Implementation for general platforms" 7 | 8 | config XTENSA_IMPL 9 | bool "Xtensa Implementation for ESP" 10 | 11 | endchoice 12 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/face__detection__forward_8h__incl.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /components/esp-face/lib/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := include 2 | 3 | COMPONENT_SRCDIRS := . 4 | 5 | LIB_FILES := $(shell ls $(COMPONENT_PATH)/lib*.a) 6 | 7 | LIBS := $(patsubst lib%.a,-l%,$(notdir $(LIB_FILES))) 8 | 9 | COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/ $(LIBS) 10 | 11 | ALL_LIB_FILES += $(LIB_FILES) 12 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # This is a project Makefile. It is assumed the directory this Makefile resides in is a 3 | # project subdirectory. 4 | # 5 | 6 | PROJECT_NAME := camera_web_server 7 | 8 | SOLUTION_PATH ?= $(abspath $(shell pwd)) 9 | 10 | include $(SOLUTION_PATH)/components/component_conf.mk 11 | include $(IDF_PATH)/make/project.mk 12 | 13 | -------------------------------------------------------------------------------- /components/component_conf.mk: -------------------------------------------------------------------------------- 1 | EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components 2 | EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/lib 3 | EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/image_util 4 | EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/face_detection 5 | EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/face_recognition 6 | -------------------------------------------------------------------------------- /components/esp-face/Makefile: -------------------------------------------------------------------------------- 1 | PROJECT_NAME := esp_face 2 | 3 | MODULE_PATH := $(abspath $(shell pwd)) 4 | 5 | EXTRA_COMPONENT_DIRS += $(MODULE_PATH)/lib 6 | EXTRA_COMPONENT_DIRS += $(MODULE_PATH)/image_util 7 | EXTRA_COMPONENT_DIRS += $(MODULE_PATH)/face_detection 8 | EXTRA_COMPONENT_DIRS += $(MODULE_PATH)/face_recognition 9 | 10 | include $(IDF_PATH)/make/project.mk 11 | 12 | -------------------------------------------------------------------------------- /components/recorder_engine/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := . \ 2 | ./include 3 | 4 | COMPONENT_SRCDIRS := . \ 5 | ./include 6 | 7 | LIBS := esp_wakenet nn_model 8 | 9 | COMPONENT_ADD_LDFLAGS := -L$(COMPONENT_PATH)/ $(addprefix -l,$(LIBS)) 10 | 11 | ALL_LIB_FILES += $(patsubst %,$(COMPONENT_PATH)/lib%.a,$(LIBS)) 12 | 13 | -------------------------------------------------------------------------------- /components/esp-face/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change log for esp-face 2 | 3 | ## 0.1.0 4 | Initial commit, esp-face appear in the world. 5 | 6 | ## 0.2.0 7 | Make face detection and recognition forward open source. 8 | Refactor some codes. 9 | 10 | ## 0.3.0 11 | Add flash function to enroll face id. 12 | 13 | ## 0.3.1 14 | Make aligned face easier to pass to recognition part. 15 | 16 | ## 0.3.2 17 | Change model from RGB to BGR 18 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/annotated.tex: -------------------------------------------------------------------------------- 1 | \section{Data Structures} 2 | Here are the data structures with brief descriptions\+:\begin{DoxyCompactList} 3 | \item\contentsline{section}{\hyperlink{structmtmn__net__t}{mtmn\+\_\+net\+\_\+t} }{\pageref{structmtmn__net__t}}{} 4 | \item\contentsline{section}{\hyperlink{structnet__config__t}{net\+\_\+config\+\_\+t} }{\pageref{structnet__config__t}}{} 5 | \end{DoxyCompactList} 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.lib 27 | 28 | # Executables 29 | *.exe 30 | *.out 31 | *.app 32 | 33 | /build 34 | *.old -------------------------------------------------------------------------------- /components/esp32-camera/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Camera configuration" 2 | 3 | config OV2640_SUPPORT 4 | bool "OV2640 Support" 5 | default y 6 | help 7 | Enable this option if you want to use the OV2640. 8 | Disable this option to safe memory. 9 | 10 | config OV7725_SUPPORT 11 | bool "OV7725 Support" 12 | default n 13 | help 14 | Enable this option if you want to use the OV7725. 15 | Disable this option to safe memory. 16 | 17 | endmenu 18 | -------------------------------------------------------------------------------- /components/esp32-camera/sensors/private_include/ov2640.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * OV2640 driver. 7 | * 8 | */ 9 | #ifndef __OV2640_H__ 10 | #define __OV2640_H__ 11 | #include "sensor.h" 12 | int ov2640_init(sensor_t *sensor); 13 | #endif // __OV2640_H__ 14 | -------------------------------------------------------------------------------- /main/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Main Makefile. This is basically the same as a component makefile. 3 | # 4 | # This Makefile should, at the very least, just include $(SDK_PATH)/make/component.mk. By default, 5 | # this will take the sources in the src/ directory, compile them and link them into 6 | # lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable, 7 | # please read the SDK documents if you need to do this. 8 | # 9 | 10 | -------------------------------------------------------------------------------- /components/esp32-camera/sensors/private_include/ov7725.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * OV7725 driver. 7 | * 8 | */ 9 | #ifndef __OV7725_H__ 10 | #define __OV7725_H__ 11 | #include "sensor.h" 12 | 13 | int ov7725_init(sensor_t *sensor); 14 | #endif // __OV7725_H__ 15 | -------------------------------------------------------------------------------- /components/esp32-camera/driver/sensor.c: -------------------------------------------------------------------------------- 1 | 2 | const int resolution[][2] = { 3 | { 160, 120 }, /* QQVGA */ 4 | { 128, 160 }, /* QQVGA2*/ 5 | { 176, 144 }, /* QCIF */ 6 | { 240, 176 }, /* HQVGA */ 7 | { 320, 240 }, /* QVGA */ 8 | { 400, 296 }, /* CIF */ 9 | { 640, 480 }, /* VGA */ 10 | { 800, 600 }, /* SVGA */ 11 | { 1024, 768 }, /* XGA */ 12 | { 1280, 1024 }, /* SXGA */ 13 | { 1600, 1200 }, /* UXGA */ 14 | }; 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /main/build/CMakeFiles/3.11.1/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Windows-10.0.17763") 2 | set(CMAKE_HOST_SYSTEM_NAME "Windows") 3 | set(CMAKE_HOST_SYSTEM_VERSION "10.0.17763") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Windows-10.0.17763") 9 | set(CMAKE_SYSTEM_NAME "Windows") 10 | set(CMAKE_SYSTEM_VERSION "10.0.17763") 11 | set(CMAKE_SYSTEM_PROCESSOR "AMD64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /components/esp-face/lib/include/frmn.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if __cplusplus 4 | extern "C" 5 | { 6 | #endif 7 | 8 | #include "dl_lib.h" 9 | 10 | /** 11 | * @brief 12 | * 13 | * @param in 14 | * @return dl_matrix3d_t* 15 | */ 16 | dl_matrix3d_t *frmn(dl_matrix3d_t *in); 17 | 18 | /** 19 | * @brief 20 | * 21 | * @param in 22 | * @return dl_matrix3dq_t* 23 | */ 24 | dl_matrix3dq_t *frmn_q(dl_matrix3dq_t *in, dl_conv_mode mode); 25 | 26 | #if __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/files.tex: -------------------------------------------------------------------------------- 1 | \section{File List} 2 | Here is a list of all files with brief descriptions\+:\begin{DoxyCompactList} 3 | \item\contentsline{section}{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include/\hyperlink{face__detection__forward_8h}{face\+\_\+detection\+\_\+forward.\+h} }{\pageref{face__detection__forward_8h}}{} 4 | \item\contentsline{section}{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include/\hyperlink{mtmn_8h}{mtmn.\+h} }{\pageref{mtmn_8h}}{} 5 | \end{DoxyCompactList} 6 | -------------------------------------------------------------------------------- /components/esp32-camera/driver/private_include/sccb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * SCCB (I2C like) driver. 7 | * 8 | */ 9 | #ifndef __SCCB_H__ 10 | #define __SCCB_H__ 11 | #include 12 | int SCCB_Init(int pin_sda, int pin_scl); 13 | uint8_t SCCB_Probe(); 14 | uint8_t SCCB_Read(uint8_t slv_addr, uint8_t reg); 15 | uint8_t SCCB_Write(uint8_t slv_addr, uint8_t reg, uint8_t data); 16 | #endif // __SCCB_H__ 17 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/Makefile: -------------------------------------------------------------------------------- 1 | all: refman.pdf 2 | 3 | pdf: refman.pdf 4 | 5 | refman.pdf: clean refman.tex 6 | pdflatex refman 7 | makeindex refman.idx 8 | pdflatex refman 9 | latex_count=8 ; \ 10 | while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ 11 | do \ 12 | echo "Rerunning latex...." ;\ 13 | pdflatex refman ;\ 14 | latex_count=`expr $$latex_count - 1` ;\ 15 | done 16 | makeindex refman.idx 17 | pdflatex refman 18 | 19 | 20 | clean: 21 | rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf 22 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/dir_f92cccad4fdd005aca3e808d97427089.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{dir_f92cccad4fdd005aca3e808d97427089}{}\section{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection Directory Reference} 2 | \label{dir_f92cccad4fdd005aca3e808d97427089}\index{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection Directory Reference@{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection Directory Reference}} 3 | \subsection*{Directories} 4 | \begin{DoxyCompactItemize} 5 | \item 6 | directory \hyperlink{dir_b1c38619a7f75ea3a62b0ffb4d1217b3}{mtmn} 7 | \end{DoxyCompactItemize} 8 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/dir_b1c38619a7f75ea3a62b0ffb4d1217b3.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{dir_b1c38619a7f75ea3a62b0ffb4d1217b3}{}\section{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn Directory Reference} 2 | \label{dir_b1c38619a7f75ea3a62b0ffb4d1217b3}\index{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn Directory Reference@{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn Directory Reference}} 3 | \subsection*{Directories} 4 | \begin{DoxyCompactItemize} 5 | \item 6 | directory \hyperlink{dir_192612bb567615e1828468f80da02f9d}{include} 7 | \end{DoxyCompactItemize} 8 | -------------------------------------------------------------------------------- /components/esp32-camera/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(COMPONENT_SRCS 2 | driver/camera.c 3 | driver/sccb.c 4 | driver/sensor.c 5 | driver/twi.c 6 | driver/xclk.c 7 | sensors/ov2640.c 8 | sensors/ov7725.c 9 | conversions/yuv.c 10 | conversions/to_jpg.cpp 11 | conversions/to_bmp.c 12 | conversions/jpge.cpp 13 | conversions/esp_jpg_decode.c 14 | ) 15 | 16 | set(COMPONENT_ADD_INCLUDEDIRS 17 | driver/include 18 | conversions/include 19 | ) 20 | 21 | set(COMPONENT_PRIV_INCLUDEDIRS 22 | driver/private_include 23 | sensors/private_include 24 | conversions/private_include 25 | ) 26 | 27 | set(COMPONENT_REQUIRES driver) 28 | set(COMPONENT_PRIV_REQUIRES freertos) 29 | 30 | register_component() 31 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/dir_192612bb567615e1828468f80da02f9d.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{dir_192612bb567615e1828468f80da02f9d}{}\section{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include Directory Reference} 2 | \label{dir_192612bb567615e1828468f80da02f9d}\index{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include Directory Reference@{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include Directory Reference}} 3 | \subsection*{Files} 4 | \begin{DoxyCompactItemize} 5 | \item 6 | file \hyperlink{face__detection__forward_8h}{face\+\_\+detection\+\_\+forward.\+h} 7 | \item 8 | file \hyperlink{mtmn_8h}{mtmn.\+h} 9 | \end{DoxyCompactItemize} 10 | -------------------------------------------------------------------------------- /main/build/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /main/include/app_httpd.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #ifndef _CAMERA_HTTPD_H_ 15 | #define _CAMERA_HTTPD_H_ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void app_httpd_main(); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif /* _CAMERA_HTTPD_H_ */ 28 | -------------------------------------------------------------------------------- /components/esp32-camera/conversions/private_include/yuv.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #ifndef _CONVERSIONS_YUV_H_ 15 | #define _CONVERSIONS_YUV_H_ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #include 22 | 23 | void yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif /* _CONVERSIONS_YUV_H_ */ 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Calin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /components/esp32-camera/driver/private_include/camera_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include "rom/lldesc.h" 7 | #include "esp_err.h" 8 | #include "esp_intr_alloc.h" 9 | #include "freertos/FreeRTOS.h" 10 | #include "freertos/semphr.h" 11 | #include "freertos/task.h" 12 | #include "esp_camera.h" 13 | #include "sensor.h" 14 | 15 | typedef union { 16 | struct { 17 | uint8_t sample2; 18 | uint8_t unused2; 19 | uint8_t sample1; 20 | uint8_t unused1; 21 | }; 22 | uint32_t val; 23 | } dma_elem_t; 24 | 25 | typedef enum { 26 | /* camera sends byte sequence: s1, s2, s3, s4, ... 27 | * fifo receives: 00 s1 00 s2, 00 s2 00 s3, 00 s3 00 s4, ... 28 | */ 29 | SM_0A0B_0B0C = 0, 30 | /* camera sends byte sequence: s1, s2, s3, s4, ... 31 | * fifo receives: 00 s1 00 s2, 00 s3 00 s4, ... 32 | */ 33 | SM_0A0B_0C0D = 1, 34 | /* camera sends byte sequence: s1, s2, s3, s4, ... 35 | * fifo receives: 00 s1 00 00, 00 s2 00 00, 00 s3 00 00, ... 36 | */ 37 | SM_0A00_0B00 = 3, 38 | } i2s_sampling_mode_t; 39 | 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # esp32_idf_camera_app 2 | ESP32 camera firmware that support various camera models 3 | 4 | # Camera with Web Server 5 | 6 | # Preparation 7 | 8 | To run this example, you need [ESP-IDF](https://github.com/espressif/esp-idf) 9 | 10 | # Quick Start 11 | 12 | After you've completed the hardware settings, please follow the steps below: 13 | 14 | 1. **Connect** the camera to ESP32 module; 15 | 2. **Configure** the example through `make menuconfig` 16 | or the faster `idf.py menuconfig` if you are using [ESP-IDF v3.2 or above](https://github.com/espressif/esp-idf/tree/release/v3.2), that support Cmake; 17 | 3. **Build** the application`make all` or the faster `idf.py build`; 18 | 4. **Flash** the application`make flash` or `idf.py flash`; 19 | 5. **Open Your Browser** and point it to `http://[ip-of-esp32]/`; 20 | If you use AP mode, first connect to AccessPoint created by ESP32 then open http://192.168.4.1/; 21 | 6. **To Get Image** press `Get Still`, `Start Stream` or `Start Stream`; 22 | stream is activated by default on http://192.168.4.1:81/stream 23 | 7. **Use The Options** to enable/disable Face Detection, Face Recognition and more; 24 | -------------------------------------------------------------------------------- /components/esp-face/main/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "freertos/FreeRTOS.h" 7 | #include "freertos/task.h" 8 | #include "freertos/queue.h" 9 | #include "esp_system.h" 10 | #include "esp_spi_flash.h" 11 | #include "esp_partition.h" 12 | #include "sdkconfig.h" 13 | 14 | 15 | void printTask(void *arg) 16 | { 17 | #define BUF_SIZE 5 * 1024 18 | char *tasklist = calloc(1, BUF_SIZE); 19 | while (1) { 20 | #if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS 21 | memset(tasklist, 0 , BUF_SIZE); 22 | vTaskGetRunTimeStats(tasklist); 23 | printf("Running tasks CPU usage: \n %s\r\n", tasklist); 24 | printf("RAM size: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT)); 25 | //ESP_LOGI(APP_TAG, "Running tasks CPU usage: \n %s\r\n", tasklist); 26 | #endif 27 | vTaskDelay(17000 / portTICK_RATE_MS); 28 | } 29 | free(tasklist); 30 | } 31 | 32 | 33 | void app_main() 34 | { 35 | printf("Start free RAM size: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL)); 36 | } 37 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/index.hhp: -------------------------------------------------------------------------------- 1 | [OPTIONS] 2 | Compatibility=1.1 3 | Full-text search=Yes 4 | Contents file=index.hhc 5 | Default Window=main 6 | Default topic=index.html 7 | Index file=index.hhk 8 | Language=0x409 English (United States) 9 | Title=mtmn 10 | 11 | [WINDOWS] 12 | main="mtmn","index.hhc","index.hhk","index.html","index.html",,,,,0x23520,,0x10387e,,,,,,,,0 13 | 14 | [FILES] 15 | face__detection__forward_8h_source.html 16 | mtmn_8h_source.html 17 | face__detection__forward_8h.html 18 | mtmn_8h.html 19 | structmtmn__net__t.html 20 | structnet__config__t.html 21 | graph_legend.html 22 | dir_f92cccad4fdd005aca3e808d97427089.html 23 | dir_192612bb567615e1828468f80da02f9d.html 24 | dir_b1c38619a7f75ea3a62b0ffb4d1217b3.html 25 | index.html 26 | annotated.html 27 | classes.html 28 | functions.html 29 | functions_vars.html 30 | files.html 31 | globals.html 32 | globals_func.html 33 | globals_enum.html 34 | globals_eval.html 35 | globals_defs.html 36 | tab_a.png 37 | tab_b.png 38 | tab_h.png 39 | tab_s.png 40 | nav_h.png 41 | nav_f.png 42 | bc_s.png 43 | doxygen.png 44 | closed.png 45 | open.png 46 | bdwn.png 47 | sync_on.png 48 | sync_off.png 49 | face__detection__forward_8h__incl.png 50 | mtmn_8h__incl.png 51 | graph_legend.png 52 | -------------------------------------------------------------------------------- /components/recorder_engine/include/esp_sr_models.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "esp_sr_iface.h" 3 | 4 | //Contains declarations of all available speech recognion models. Pair this up with the right coefficients and you have a model that can recognize 5 | //a specific phrase or word. 6 | extern const esp_sr_iface_t esp_sr_wakenet2_float; 7 | extern const esp_sr_iface_t sr_model_wakenet1_float; 8 | extern const esp_sr_iface_t sr_model_wakenet1_quantized; 9 | extern const esp_sr_iface_t esp_sr_wakenet2_quantized; 10 | extern const esp_sr_iface_t esp_sr_wakenet3_quantized; 11 | extern const esp_sr_iface_t esp_sr_wakenet4_quantized; 12 | 13 | 14 | /* example 15 | 16 | static const sr_model_iface_t *model = &sr_model_wakenet3_quantized; 17 | 18 | //Initialize wakeNet model data 19 | static model_iface_data_t *model_data=model->create(DET_MODE_90); 20 | 21 | //Set parameters of buffer 22 | int audio_chunksize=model->get_samp_chunksize(model_data); 23 | int frequency = model->get_samp_rate(model_data); 24 | int16_t *buffer=malloc(audio_chunksize*sizeof(int16_t)); 25 | 26 | //Detect 27 | int r=model->detect(model_data, buffer); 28 | if (r>0) { 29 | printf("Detection triggered output %d.\n", r); 30 | } 31 | 32 | //Destroy model 33 | model->destroy(model_data) 34 | 35 | */ 36 | -------------------------------------------------------------------------------- /components/esp-face/LICENSE: -------------------------------------------------------------------------------- 1 | ESPRESSIF MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case, 6 | it is free of charge, to any person obtaining a copy of this software and associated 7 | documentation files (the "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /components/esp-face/face_recognition/include/fr_flash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if __cplusplus 4 | extern "C" 5 | { 6 | #endif 7 | 8 | #include "fr_forward.h" 9 | 10 | #define FR_FLASH_TYPE 32 11 | #define FR_FLASH_SUBTYPE 32 12 | #define FR_FLASH_PARTITION_NAME "fr" 13 | #define FR_FLASH_INFO_FLAG 12138 14 | 15 | /** 16 | * @brief Produce face id according to the input aligned face, and save it to dest_id and flash. 17 | * 18 | * @param l Face id list 19 | * @param aligned_face An aligned face 20 | * @return -2 Flash partition not found 21 | * @return 0 Enrollment finish 22 | * @return >=1 The left piece of aligned faces should be input 23 | */ 24 | int8_t enroll_face_id_to_flash(face_id_list *l, 25 | dl_matrix3du_t *aligned_face); 26 | 27 | /** 28 | * @brief Read the enrolled face IDs from the flash. 29 | * 30 | * @param l Face id list 31 | * @return int8_t The number of IDs remaining in flash 32 | */ 33 | int8_t read_face_id_from_flash(face_id_list *l); 34 | 35 | /** 36 | * @brief Delete the enrolled face IDs in the flash. 37 | * 38 | * @param l Face id list 39 | * @return int8_t The number of IDs remaining in flash 40 | */ 41 | int8_t delete_face_id_in_flash(face_id_list *l); 42 | 43 | #if __cplusplus 44 | } 45 | #endif 46 | -------------------------------------------------------------------------------- /components/esp32-camera/driver/private_include/twi.h: -------------------------------------------------------------------------------- 1 | /* 2 | twi.h - Software I2C library for ESP31B 3 | 4 | Copyright (c) 2015 Hristo Gochkov. All rights reserved. 5 | This file is part of the ESP31B core for Arduino environment. 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | #ifndef SI2C_h 22 | #define SI2C_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | void twi_init(unsigned char sda, unsigned char scl); 29 | void twi_stop(void); 30 | void twi_setClock(unsigned int freq); 31 | uint8_t twi_writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop); 32 | uint8_t twi_readFrom(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif -------------------------------------------------------------------------------- /main/app_main.c: -------------------------------------------------------------------------------- 1 | /* ESPRESSIF MIT License 2 | * 3 | * Copyright (c) 2018 4 | * 5 | * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case, 6 | * it is free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished 10 | * to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all copies or 13 | * substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #include "app_camera.h" 24 | #include "app_wifi.h" 25 | #include "app_httpd.h" 26 | 27 | void app_main() 28 | { 29 | app_wifi_main(); 30 | app_camera_main(); 31 | app_httpd_main(); 32 | } 33 | -------------------------------------------------------------------------------- /components/esp32-camera/conversions/include/esp_jpg_decode.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #ifndef _ESP_JPG_DECODE_H_ 15 | #define _ESP_JPG_DECODE_H_ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #include 22 | #include 23 | #include 24 | #include "esp_err.h" 25 | 26 | typedef enum { 27 | JPG_SCALE_NONE, 28 | JPG_SCALE_2X, 29 | JPG_SCALE_4X, 30 | JPG_SCALE_8X, 31 | JPG_SCALE_MAX = JPG_SCALE_8X 32 | } jpg_scale_t; 33 | 34 | typedef size_t (* jpg_reader_cb)(void * arg, size_t index, uint8_t *buf, size_t len); 35 | typedef bool (* jpg_writer_cb)(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data); 36 | 37 | esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* _ESP_JPG_DECODE_H_ */ 44 | -------------------------------------------------------------------------------- /main/include/app_wifi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ESPRESSIF MIT License 3 | * 4 | * Copyright (c) 2017 5 | * 6 | * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, 7 | * it is free of charge, to any person obtaining a copy of this software and associated 8 | * documentation files (the "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished 11 | * to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or 14 | * substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | #ifndef _APP_WIFI_H_ 25 | #define _APP_WIFI_H_ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | void app_wifi_main(); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /components/esp32-camera/driver/xclk.c: -------------------------------------------------------------------------------- 1 | #include "driver/gpio.h" 2 | #include "driver/ledc.h" 3 | #include "esp_err.h" 4 | #include "esp_log.h" 5 | #include "xclk.h" 6 | 7 | #if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) 8 | #include "esp32-hal-log.h" 9 | #else 10 | #include "esp_log.h" 11 | static const char* TAG = "camera_xclk"; 12 | #endif 13 | 14 | esp_err_t camera_enable_out_clock(camera_config_t* config) 15 | { 16 | periph_module_enable(PERIPH_LEDC_MODULE); 17 | 18 | ledc_timer_config_t timer_conf; 19 | timer_conf.duty_resolution = 2; 20 | timer_conf.freq_hz = config->xclk_freq_hz; 21 | timer_conf.speed_mode = LEDC_HIGH_SPEED_MODE; 22 | timer_conf.timer_num = config->ledc_timer; 23 | esp_err_t err = ledc_timer_config(&timer_conf); 24 | if (err != ESP_OK) { 25 | ESP_LOGE(TAG, "ledc_timer_config failed, rc=%x", err); 26 | return err; 27 | } 28 | 29 | ledc_channel_config_t ch_conf; 30 | ch_conf.gpio_num = config->pin_xclk; 31 | ch_conf.speed_mode = LEDC_HIGH_SPEED_MODE; 32 | ch_conf.channel = config->ledc_channel; 33 | ch_conf.intr_type = LEDC_INTR_DISABLE; 34 | ch_conf.timer_sel = config->ledc_timer; 35 | ch_conf.duty = 2; 36 | ch_conf.hpoint = 0; 37 | err = ledc_channel_config(&ch_conf); 38 | if (err != ESP_OK) { 39 | ESP_LOGE(TAG, "ledc_channel_config failed, rc=%x", err); 40 | return err; 41 | } 42 | return ESP_OK; 43 | } 44 | 45 | void camera_disable_out_clock() 46 | { 47 | periph_module_disable(PERIPH_LEDC_MODULE); 48 | } 49 | -------------------------------------------------------------------------------- /components/esp-face/main/Kconfig: -------------------------------------------------------------------------------- 1 | menu "ESP32 Hotword Detection" 2 | 3 | choice SR_SOURCE 4 | prompt "Speech recognition audio source" 5 | default SR_SOURCE_WAV 6 | help 7 | Select the audio source for the speech recognition. Wav reads a wave file from a partition 8 | and parses it as soon as possible. Mic needs a Lyra-T board and will use the live microphone 9 | on that board. 10 | 11 | config SR_SOURCE_WAV 12 | bool "Wav file from partition" 13 | 14 | config SR_SOURCE_MIC 15 | bool "Live microphone on LyraT-board" 16 | 17 | endchoice 18 | 19 | 20 | choice SR_MODEL_SEL 21 | prompt "Speech recognition model to use" 22 | default SR_MODEL_WN1_FLOAT 23 | help 24 | Select the model to be used. 25 | 26 | config SR_MODEL_WN1_FLOAT 27 | bool "WakeNet 1 (float)" 28 | 29 | config SR_MODEL_WN1_QUANT 30 | bool "WakeNet 1 (quantized)" 31 | 32 | config SR_MODEL_WN2_FLOAT 33 | bool "WakeNet 2 (float)" 34 | 35 | config SR_MODEL_WN3_QUANT 36 | bool "WakeNet 3 (quantized)" 37 | 38 | endchoice 39 | 40 | #Indicates if the selected NN is float (y) or quantized (n). At the moment this is only used to show/hide 41 | #the NN_CHECK_QUANTIZED_SANITY option. 42 | config NN_NO_QUANTIZED 43 | bool 44 | default y if SR_MODEL_WN1_FLOAT 45 | default n if SR_MODEL_WN1_QUANT 46 | default y if SR_MODEL_WN2_FLOAT 47 | 48 | config NN_CHECK_QUANTIZED_SANITY 49 | bool "Check sanity of quantized matrices" 50 | depends on !NN_NO_QUANTIZED 51 | default n 52 | help 53 | Checks if a lot of values in the quantized matrices are clipped, or if the bits in the mantissas 54 | are under-used. Check is run while doing neural network operations and can slow down the process 55 | a fair amount. 56 | 57 | endmenu 58 | -------------------------------------------------------------------------------- /components/fb_gfx/include/fb_gfx.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #ifndef _FB_GFX_H_ 15 | #define _FB_GFX_H_ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | typedef enum { 22 | FB_RGB888, FB_BGR888, FB_RGB565, FB_BGR565 23 | } fb_format_t; 24 | 25 | typedef struct { 26 | int width; 27 | int height; 28 | int bytes_per_pixel; 29 | fb_format_t format; 30 | uint8_t * data; 31 | } fb_data_t; 32 | 33 | void fb_gfx_fillRect (fb_data_t *fb, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color); 34 | void fb_gfx_drawFastHLine(fb_data_t *fb, int32_t x, int32_t y, int32_t w, uint32_t color); 35 | void fb_gfx_drawFastVLine(fb_data_t *fb, int32_t x, int32_t y, int32_t h, uint32_t color); 36 | uint8_t fb_gfx_putc (fb_data_t *fb, int32_t x, int32_t y, uint32_t color, unsigned char c); 37 | uint32_t fb_gfx_print (fb_data_t *fb, int32_t x, int32_t y, uint32_t color, const char * str); 38 | uint32_t fb_gfx_printf (fb_data_t *fb, int32_t x, int32_t y, uint32_t color, const char *format, ...); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _FB_GFX_H_ */ 45 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Main Page 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 |
37 |
38 |
39 |
mtmn Documentation
40 |
41 |
42 |
43 | 44 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/structmtmn__net__t.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structmtmn__net__t}{}\section{mtmn\+\_\+net\+\_\+t Struct Reference} 2 | \label{structmtmn__net__t}\index{mtmn\+\_\+net\+\_\+t@{mtmn\+\_\+net\+\_\+t}} 3 | 4 | 5 | {\ttfamily \#include $<$mtmn.\+h$>$} 6 | 7 | \subsection*{Data Fields} 8 | \begin{DoxyCompactItemize} 9 | \item 10 | dl\+\_\+matrix3d\+\_\+t $\ast$ \hyperlink{structmtmn__net__t_a1d3531c1210c49940c846cd600b6d2f8}{category} 11 | \item 12 | dl\+\_\+matrix3d\+\_\+t $\ast$ \hyperlink{structmtmn__net__t_a0903a36fc3368901a05211a31007653b}{offset} 13 | \item 14 | dl\+\_\+matrix3d\+\_\+t $\ast$ \hyperlink{structmtmn__net__t_a47e72642944e5a6a519942b74c540aec}{landmark} 15 | \end{DoxyCompactItemize} 16 | 17 | 18 | \subsection{Field Documentation} 19 | \index{mtmn\+\_\+net\+\_\+t@{mtmn\+\_\+net\+\_\+t}!category@{category}} 20 | \index{category@{category}!mtmn\+\_\+net\+\_\+t@{mtmn\+\_\+net\+\_\+t}} 21 | \subsubsection[{\texorpdfstring{category}{category}}]{\setlength{\rightskip}{0pt plus 5cm}dl\+\_\+matrix3d\+\_\+t$\ast$ category}\hypertarget{structmtmn__net__t_a1d3531c1210c49940c846cd600b6d2f8}{}\label{structmtmn__net__t_a1d3531c1210c49940c846cd600b6d2f8} 22 | \index{mtmn\+\_\+net\+\_\+t@{mtmn\+\_\+net\+\_\+t}!landmark@{landmark}} 23 | \index{landmark@{landmark}!mtmn\+\_\+net\+\_\+t@{mtmn\+\_\+net\+\_\+t}} 24 | \subsubsection[{\texorpdfstring{landmark}{landmark}}]{\setlength{\rightskip}{0pt plus 5cm}dl\+\_\+matrix3d\+\_\+t$\ast$ landmark}\hypertarget{structmtmn__net__t_a47e72642944e5a6a519942b74c540aec}{}\label{structmtmn__net__t_a47e72642944e5a6a519942b74c540aec} 25 | \index{mtmn\+\_\+net\+\_\+t@{mtmn\+\_\+net\+\_\+t}!offset@{offset}} 26 | \index{offset@{offset}!mtmn\+\_\+net\+\_\+t@{mtmn\+\_\+net\+\_\+t}} 27 | \subsubsection[{\texorpdfstring{offset}{offset}}]{\setlength{\rightskip}{0pt plus 5cm}dl\+\_\+matrix3d\+\_\+t$\ast$ offset}\hypertarget{structmtmn__net__t_a0903a36fc3368901a05211a31007653b}{}\label{structmtmn__net__t_a0903a36fc3368901a05211a31007653b} 28 | 29 | 30 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 31 | \item 32 | /home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include/\hyperlink{mtmn_8h}{mtmn.\+h}\end{DoxyCompactItemize} 33 | -------------------------------------------------------------------------------- /components/esp-face/lib/include/dl_lib_coefgetter_if.h: -------------------------------------------------------------------------------- 1 | #ifndef DL_LIB_COEFGETTER_IF_H 2 | #define DL_LIB_COEFGETTER_IF_H 3 | 4 | #include "dl_lib_matrix.h" 5 | #include "dl_lib_matrixq.h" 6 | #include "dl_lib_matrix3d.h" 7 | #include "dl_lib_matrix3dq.h" 8 | 9 | //Set this if the coefficient requested is a batch-normalization popvar matrix which needs to be preprocessed by 10 | //dl_batch_normalize_get_sqrtvar first. 11 | #define COEF_GETTER_HINT_BNVAR (1<<0) 12 | 13 | /* 14 | This struct describes the basic information of model data: 15 | word_num: the number of wake words or speech commands 16 | word_list: the name list of wake words or speech commands 17 | thres_list: the threshold list of wake words or speech commands 18 | info_str: the string used to reflect the version and information of model data 19 | which consist of the architecture of network, the version of model data, wake words and their threshold 20 | */ 21 | typedef struct { 22 | int word_num; 23 | char **word_list; 24 | int *win_list; 25 | float *thresh_list; 26 | char *info_str; 27 | } model_info_t; 28 | 29 | /* 30 | This struct describes a generic coefficient getter: a way to get the constant coefficients needed for a neural network. 31 | For the two getters, the name describes the name of the coefficient matrix, usually the same as the Numpy filename the 32 | coefficient was originally stored in. The arg argument can be used to optionally pass an additional user-defined argument 33 | to the getter (e.g. the directory to look for files in the case of the Numpy file loader getter). The hint argument 34 | is a bitwise OR of the COEF_GETTER_HINT_* flags or 0 when none is needed. Use the free_f/free_q functions to release the 35 | memory for the returned matrices, when applicable. 36 | */ 37 | typedef struct { 38 | const dl_matrix2d_t* (*getter_f)(const char *name, void *arg, int hint); 39 | const dl_matrix2dq_t* (*getter_q)(const char *name, void *arg, int hint); 40 | const dl_matrix3d_t* (*getter_3d)(const char *name, void *arg, int hint); 41 | const dl_matrix3dq_t* (*getter_3dq)(const char *name, void *arg, int hint); 42 | void (*free_f)(const dl_matrix2d_t *m); 43 | void (*free_q)(const dl_matrix2dq_t *m); 44 | const model_info_t* (*getter_info)(void *arg); 45 | } model_coeff_getter_t; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /components/esp32-camera/driver/sccb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * SCCB (I2C like) driver. 7 | * 8 | */ 9 | #include 10 | #include 11 | #include 12 | #include "sccb.h" 13 | #include "twi.h" 14 | #include 15 | #include "sdkconfig.h" 16 | #if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) 17 | #include "esp32-hal-log.h" 18 | #else 19 | #include "esp_log.h" 20 | static const char* TAG = "sccb"; 21 | #endif 22 | 23 | 24 | #define SCCB_FREQ (100000) // We don't need fast I2C. 100KHz is fine here. 25 | #define TIMEOUT (1000) /* Can't be sure when I2C routines return. Interrupts 26 | while polling hardware may result in unknown delays. */ 27 | 28 | 29 | int SCCB_Init(int pin_sda, int pin_scl) 30 | { 31 | twi_init(pin_sda, pin_scl); 32 | return 0; 33 | } 34 | 35 | uint8_t SCCB_Probe() 36 | { 37 | uint8_t reg = 0x00; 38 | uint8_t slv_addr = 0x00; 39 | 40 | for (uint8_t i=0; i<127; i++) { 41 | if (twi_writeTo(i, ®, 1, true) == 0) { 42 | slv_addr = i; 43 | break; 44 | } 45 | 46 | if (i!=126) { 47 | vTaskDelay(1 / portTICK_PERIOD_MS); // Necessary for OV7725 camera (not for OV2640). 48 | } 49 | } 50 | return slv_addr; 51 | } 52 | 53 | uint8_t SCCB_Read(uint8_t slv_addr, uint8_t reg) 54 | { 55 | uint8_t data=0; 56 | 57 | int rc = twi_writeTo(slv_addr, ®, 1, true); 58 | if (rc != 0) { 59 | data = 0xff; 60 | } else { 61 | rc = twi_readFrom(slv_addr, &data, 1, true); 62 | if (rc != 0) { 63 | data=0xFF; 64 | } 65 | } 66 | if (rc != 0) { 67 | ESP_LOGE(TAG, "SCCB_Read [%02x] failed rc=%d\n", reg, rc); 68 | } 69 | return data; 70 | } 71 | 72 | uint8_t SCCB_Write(uint8_t slv_addr, uint8_t reg, uint8_t data) 73 | { 74 | uint8_t ret=0; 75 | uint8_t buf[] = {reg, data}; 76 | 77 | if(twi_writeTo(slv_addr, buf, 2, true) != 0) { 78 | ret=0xFF; 79 | } 80 | if (ret != 0) { 81 | printf("SCCB_Write [%02x]=%02x failed\n", reg, data); 82 | } 83 | return ret; 84 | } 85 | -------------------------------------------------------------------------------- /main/build/CMakeFiles/3.11.1/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "C:/msys32/usr/bin/cc.exe") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "7.3.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "Cygwin") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_SIMULATE_VERSION "") 16 | 17 | 18 | 19 | set(CMAKE_AR "C:/msys32/usr/bin/ar.exe") 20 | set(CMAKE_C_COMPILER_AR "C:/msys32/usr/bin/gcc-ar.exe") 21 | set(CMAKE_RANLIB "C:/msys32/usr/bin/ranlib.exe") 22 | set(CMAKE_C_COMPILER_RANLIB "C:/msys32/usr/bin/gcc-ranlib.exe") 23 | set(CMAKE_LINKER "C:/msys32/usr/bin/ld.exe") 24 | set(CMAKE_COMPILER_IS_GNUCC 1) 25 | set(CMAKE_C_COMPILER_LOADED 1) 26 | set(CMAKE_C_COMPILER_WORKS TRUE) 27 | set(CMAKE_C_ABI_COMPILED TRUE) 28 | set(CMAKE_COMPILER_IS_MINGW ) 29 | set(CMAKE_COMPILER_IS_CYGWIN 1) 30 | if(CMAKE_COMPILER_IS_CYGWIN) 31 | set(CYGWIN 1) 32 | set(UNIX 1) 33 | endif() 34 | 35 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 36 | 37 | if(CMAKE_COMPILER_IS_MINGW) 38 | set(MINGW 1) 39 | endif() 40 | set(CMAKE_C_COMPILER_ID_RUN 1) 41 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 42 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 43 | set(CMAKE_C_LINKER_PREFERENCE 10) 44 | 45 | # Save compiler ABI information. 46 | set(CMAKE_C_SIZEOF_DATA_PTR "4") 47 | set(CMAKE_C_COMPILER_ABI "") 48 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 49 | 50 | if(CMAKE_C_SIZEOF_DATA_PTR) 51 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 52 | endif() 53 | 54 | if(CMAKE_C_COMPILER_ABI) 55 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 56 | endif() 57 | 58 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 59 | set(CMAKE_LIBRARY_ARCHITECTURE "") 60 | endif() 61 | 62 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 63 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 64 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 65 | endif() 66 | 67 | 68 | 69 | 70 | 71 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc_s;gcc;msys-2.0;advapi32;shell32;user32;kernel32;gcc_s;gcc") 72 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/i686-pc-msys/7.3.0;/usr/i686-pc-msys/lib;/usr/lib/w32api") 73 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 74 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/globals_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Globals 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 51 |
52 |
53 |  
    54 |
  • net_type_en 55 | : mtmn.h 56 |
  • 57 |
58 |
59 | 60 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /components/esp-face/face_detection/include/fd_forward.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ESPRESSIF MIT License 3 | * 4 | * Copyright (c) 2018 5 | * 6 | * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, 7 | * it is free of charge, to any person obtaining a copy of this software and associated 8 | * documentation files (the "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished 11 | * to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or 14 | * substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | #pragma once 25 | 26 | #if __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include "image_util.h" 32 | #include "dl_lib.h" 33 | #include "mtmn.h" 34 | 35 | static inline mtmn_config_t mtmn_init_config() 36 | { 37 | mtmn_config_t mtmn_config; 38 | mtmn_config.min_face = 80; 39 | mtmn_config.pyramid = 0.7; 40 | mtmn_config.p_threshold.score = 0.6; 41 | mtmn_config.p_threshold.nms = 0.7; 42 | mtmn_config.r_threshold.score = 0.6; 43 | mtmn_config.r_threshold.nms = 0.7; 44 | mtmn_config.r_threshold.candidate_number = 4; 45 | mtmn_config.o_threshold.score = 0.6; 46 | mtmn_config.o_threshold.nms = 0.4; 47 | mtmn_config.o_threshold.candidate_number = 1; 48 | 49 | return mtmn_config; 50 | } 51 | 52 | /** 53 | * @brief Do MTMN face detection, return box and landmark infomation. 54 | * 55 | * @param image_matrix Image matrix, rgb888 format 56 | * @param config Configuration of MTMN i.e. score threshold, nms threshold, candidate number threshold, pyramid, min face size 57 | * @return box_array_t* A list of boxes and score. 58 | */ 59 | box_array_t *face_detect(dl_matrix3du_t *image_matrix, 60 | mtmn_config_t *config); 61 | 62 | #if __cplusplus 63 | } 64 | #endif 65 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/globals_defs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Globals 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 51 |
52 |
53 |   58 |
59 | 60 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | 2 | CONFIG_ESPTOOLPY_PORT="/dev/ttyUSB1" 3 | CONFIG_ESPTOOLPY_BAUD_115200B= 4 | CONFIG_ESPTOOLPY_BAUD_230400B= 5 | CONFIG_ESPTOOLPY_BAUD_921600B=y 6 | CONFIG_ESPTOOLPY_BAUD_2MB= 7 | CONFIG_ESPTOOLPY_BAUD_OTHER= 8 | CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 9 | CONFIG_ESPTOOLPY_BAUD=921600 10 | CONFIG_ESPTOOLPY_COMPRESSED=y 11 | CONFIG_FLASHMODE_QIO=y 12 | CONFIG_FLASHMODE_QOUT= 13 | CONFIG_FLASHMODE_DIO= 14 | CONFIG_FLASHMODE_DOUT= 15 | CONFIG_ESPTOOLPY_FLASHMODE="dio" 16 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 17 | CONFIG_ESPTOOLPY_FLASHFREQ_40M= 18 | CONFIG_ESPTOOLPY_FLASHFREQ_26M= 19 | CONFIG_ESPTOOLPY_FLASHFREQ_20M= 20 | CONFIG_ESPTOOLPY_FLASHFREQ="80m" 21 | CONFIG_ESPTOOLPY_FLASHSIZE_1MB= 22 | CONFIG_ESPTOOLPY_FLASHSIZE_2MB= 23 | CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y 24 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB= 25 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB= 26 | CONFIG_ESPTOOLPY_FLASHSIZE="4MB" 27 | CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y 28 | CONFIG_ESPTOOLPY_BEFORE_RESET=y 29 | CONFIG_ESPTOOLPY_BEFORE_NORESET= 30 | CONFIG_ESPTOOLPY_BEFORE="default_reset" 31 | CONFIG_ESPTOOLPY_AFTER_RESET=y 32 | CONFIG_ESPTOOLPY_AFTER_NORESET= 33 | CONFIG_ESPTOOLPY_AFTER="hard_reset" 34 | CONFIG_MONITOR_BAUD_9600B= 35 | CONFIG_MONITOR_BAUD_57600B= 36 | CONFIG_MONITOR_BAUD_115200B=y 37 | CONFIG_MONITOR_BAUD_230400B= 38 | CONFIG_MONITOR_BAUD_921600B= 39 | CONFIG_MONITOR_BAUD_2MB= 40 | CONFIG_MONITOR_BAUD_OTHER= 41 | CONFIG_MONITOR_BAUD_OTHER_VAL=115200 42 | CONFIG_MONITOR_BAUD=115200 43 | 44 | # 45 | # Partition Table 46 | # 47 | CONFIG_PARTITION_TABLE_SINGLE_APP= 48 | CONFIG_PARTITION_TABLE_TWO_OTA= 49 | CONFIG_PARTITION_TABLE_CUSTOM=y 50 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 51 | CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" 52 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 53 | CONFIG_PARTITION_TABLE_MD5=y 54 | # 55 | # Camera configuration 56 | # 57 | CONFIG_ENABLE_TEST_PATTERN= 58 | CONFIG_OV2640_SUPPORT=y 59 | CONFIG_OV7725_SUPPORT= 60 | 61 | # 62 | # ESP32-specific 63 | # 64 | CONFIG_ESP32_DEFAULT_CPU_FREQ_80= 65 | CONFIG_ESP32_DEFAULT_CPU_FREQ_160= 66 | CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y 67 | CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 68 | CONFIG_SPIRAM_SUPPORT=y 69 | 70 | # 71 | # SPI RAM config 72 | # 73 | CONFIG_SPIRAM_BOOT_INIT=y 74 | CONFIG_SPIRAM_IGNORE_NOTFOUND= 75 | CONFIG_SPIRAM_USE_MEMMAP= 76 | CONFIG_SPIRAM_USE_CAPS_ALLOC=y 77 | CONFIG_SPIRAM_USE_MALLOC= 78 | CONFIG_SPIRAM_TYPE_AUTO=y 79 | CONFIG_SPIRAM_TYPE_ESPPSRAM32= 80 | CONFIG_SPIRAM_TYPE_ESPPSRAM64= 81 | CONFIG_SPIRAM_SIZE=-1 82 | CONFIG_SPIRAM_SPEED_40M= 83 | CONFIG_SPIRAM_SPEED_80M=y 84 | CONFIG_SPIRAM_MEMTEST=y 85 | CONFIG_SPIRAM_CACHE_WORKAROUND=y 86 | CONFIG_SPIRAM_BANKSWITCH_ENABLE=y 87 | CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 88 | CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST= 89 | CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY= 90 | 91 | CONFIG_TASK_WDT= 92 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/globals_eval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Globals 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 51 |
52 |
53 |  
    54 |
  • ONET 55 | : mtmn.h 56 |
  • 57 |
  • PNET 58 | : mtmn.h 59 |
  • 60 |
  • RNET 61 | : mtmn.h 62 |
  • 63 |
64 |
65 | 66 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/dir_f92cccad4fdd005aca3e808d97427089.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: /home/yehangyang/Documents/Gitlab/others/esp-face/face_detection Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 46 |
47 |
48 |
49 |
face_detection Directory Reference
50 |
51 |
52 | 53 | 55 | 56 | 57 |

54 | Directories

directory  mtmn
 
58 |
59 | 60 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Data Structures 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 43 |
44 |
45 |
46 |
Data Structures
47 |
48 |
49 |
Here are the data structures with brief descriptions:
50 | 51 | 52 | 53 |
 Cmtmn_net_t
 Cnet_config_t
54 |
55 |
56 | 57 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/globals_func.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Globals 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 51 |
52 |
53 |   67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/dir_b1c38619a7f75ea3a62b0ffb4d1217b3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: /home/yehangyang/Documents/Gitlab/others/esp-face/face_detection/mtmn Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 46 |
47 |
48 |
49 |
mtmn Directory Reference
50 |
51 |
52 | 53 | 55 | 56 | 57 |

54 | Directories

directory  include
 
58 |
59 | 60 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Data Structure Index 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 43 |
44 |
45 |
46 |
Data Structure Index
47 |
48 |
49 |
M | N
50 | 51 | 54 | 55 | 56 | 57 |
  m  
52 |
  n  
53 |
mtmn_net_t   net_config_t   
58 |
M | N
59 |
60 | 61 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/face__detection__forward_8h.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{face__detection__forward_8h}{}\section{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include/face\+\_\+detection\+\_\+forward.h File Reference} 2 | \label{face__detection__forward_8h}\index{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include/face\+\_\+detection\+\_\+forward.\+h@{/home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include/face\+\_\+detection\+\_\+forward.\+h}} 3 | {\ttfamily \#include \char`\"{}image\+\_\+util.\+h\char`\"{}}\\* 4 | {\ttfamily \#include \char`\"{}dl\+\_\+lib.\+h\char`\"{}}\\* 5 | Include dependency graph for face\+\_\+detection\+\_\+forward.\+h\+:\nopagebreak 6 | \begin{figure}[H] 7 | \begin{center} 8 | \leavevmode 9 | \includegraphics[width=232pt]{face__detection__forward_8h__incl} 10 | \end{center} 11 | \end{figure} 12 | \subsection*{Macros} 13 | \begin{DoxyCompactItemize} 14 | \item 15 | \#define \hyperlink{face__detection__forward_8h_a20978e37cee4ae0da7b405df9fd15b7d}{M\+A\+X\+\_\+\+D\+E\+T\+E\+C\+T\+I\+ON}~1 16 | \end{DoxyCompactItemize} 17 | \subsection*{Functions} 18 | \begin{DoxyCompactItemize} 19 | \item 20 | box\+\_\+array\+\_\+t $\ast$ \hyperlink{face__detection__forward_8h_a38284a9b843c9c6162f17c72f0d3fa5d}{face\+\_\+detect} (dl\+\_\+matrix3du\+\_\+t $\ast$image\+\_\+matrix) 21 | \begin{DoxyCompactList}\small\item\em Do M\+T\+MN face detection, return box and landmark infomation. \end{DoxyCompactList}\end{DoxyCompactItemize} 22 | 23 | 24 | \subsection{Macro Definition Documentation} 25 | \index{face\+\_\+detection\+\_\+forward.\+h@{face\+\_\+detection\+\_\+forward.\+h}!M\+A\+X\+\_\+\+D\+E\+T\+E\+C\+T\+I\+ON@{M\+A\+X\+\_\+\+D\+E\+T\+E\+C\+T\+I\+ON}} 26 | \index{M\+A\+X\+\_\+\+D\+E\+T\+E\+C\+T\+I\+ON@{M\+A\+X\+\_\+\+D\+E\+T\+E\+C\+T\+I\+ON}!face\+\_\+detection\+\_\+forward.\+h@{face\+\_\+detection\+\_\+forward.\+h}} 27 | \subsubsection[{\texorpdfstring{M\+A\+X\+\_\+\+D\+E\+T\+E\+C\+T\+I\+ON}{MAX_DETECTION}}]{\setlength{\rightskip}{0pt plus 5cm}\#define M\+A\+X\+\_\+\+D\+E\+T\+E\+C\+T\+I\+ON~1}\hypertarget{face__detection__forward_8h_a20978e37cee4ae0da7b405df9fd15b7d}{}\label{face__detection__forward_8h_a20978e37cee4ae0da7b405df9fd15b7d} 28 | 29 | 30 | \subsection{Function Documentation} 31 | \index{face\+\_\+detection\+\_\+forward.\+h@{face\+\_\+detection\+\_\+forward.\+h}!face\+\_\+detect@{face\+\_\+detect}} 32 | \index{face\+\_\+detect@{face\+\_\+detect}!face\+\_\+detection\+\_\+forward.\+h@{face\+\_\+detection\+\_\+forward.\+h}} 33 | \subsubsection[{\texorpdfstring{face\+\_\+detect(dl\+\_\+matrix3du\+\_\+t $\ast$image\+\_\+matrix)}{face_detect(dl_matrix3du_t *image_matrix)}}]{\setlength{\rightskip}{0pt plus 5cm}box\+\_\+array\+\_\+t$\ast$ face\+\_\+detect ( 34 | \begin{DoxyParamCaption} 35 | \item[{dl\+\_\+matrix3du\+\_\+t $\ast$}]{image\+\_\+matrix} 36 | \end{DoxyParamCaption} 37 | )}\hypertarget{face__detection__forward_8h_a38284a9b843c9c6162f17c72f0d3fa5d}{}\label{face__detection__forward_8h_a38284a9b843c9c6162f17c72f0d3fa5d} 38 | 39 | 40 | Do M\+T\+MN face detection, return box and landmark infomation. 41 | 42 | 43 | \begin{DoxyParams}{Parameters} 44 | {\em image\+\_\+matrix} & Image matrix, rgb888 format \\ 45 | \hline 46 | \end{DoxyParams} 47 | \begin{DoxyReturn}{Returns} 48 | box\+\_\+array\+\_\+t$\ast$ A list of boxes and score. 49 | \end{DoxyReturn} 50 | -------------------------------------------------------------------------------- /main/app_camera.c: -------------------------------------------------------------------------------- 1 | /* ESPRESSIF MIT License 2 | * 3 | * Copyright (c) 2018 4 | * 5 | * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case, 6 | * it is free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished 10 | * to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all copies or 13 | * substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | #include "esp_log.h" 23 | #include "esp_camera.h" 24 | #include "app_camera.h" 25 | #include "sdkconfig.h" 26 | 27 | 28 | static const char *TAG = "app_camera"; 29 | 30 | void app_camera_main () 31 | { 32 | #if CONFIG_CAMERA_MODEL_CUSTOM 33 | /* IO13, IO14 is designed for JTAG by default, 34 | * to use it as generalized input, 35 | * firstly declair it as pullup input */ 36 | gpio_config_t conf; 37 | conf.mode = GPIO_MODE_INPUT; 38 | conf.pull_up_en = GPIO_PULLUP_ENABLE; 39 | conf.pull_down_en = GPIO_PULLDOWN_DISABLE; 40 | conf.intr_type = GPIO_INTR_DISABLE; 41 | conf.pin_bit_mask = 1LL << 13; 42 | gpio_config(&conf); 43 | conf.pin_bit_mask = 1LL << 14; 44 | gpio_config(&conf); 45 | #endif 46 | 47 | camera_config_t config; 48 | config.ledc_channel = LEDC_CHANNEL_0; 49 | config.ledc_timer = LEDC_TIMER_0; 50 | config.pin_d0 = Y2_GPIO_NUM; 51 | config.pin_d1 = Y3_GPIO_NUM; 52 | config.pin_d2 = Y4_GPIO_NUM; 53 | config.pin_d3 = Y5_GPIO_NUM; 54 | config.pin_d4 = Y6_GPIO_NUM; 55 | config.pin_d5 = Y7_GPIO_NUM; 56 | config.pin_d6 = Y8_GPIO_NUM; 57 | config.pin_d7 = Y9_GPIO_NUM; 58 | config.pin_xclk = XCLK_GPIO_NUM; 59 | config.pin_pclk = PCLK_GPIO_NUM; 60 | config.pin_vsync = VSYNC_GPIO_NUM; 61 | config.pin_href = HREF_GPIO_NUM; 62 | config.pin_sscb_sda = SIOD_GPIO_NUM; 63 | config.pin_sscb_scl = SIOC_GPIO_NUM; 64 | config.pin_pwdn = PWDN_GPIO_NUM; 65 | config.pin_reset = RESET_GPIO_NUM; 66 | config.xclk_freq_hz = 20000000; 67 | config.pixel_format = PIXFORMAT_JPEG; 68 | //init with high specs to pre-allocate larger buffers 69 | config.frame_size = FRAMESIZE_QVGA; 70 | config.jpeg_quality = 10; 71 | config.fb_count = 2; 72 | 73 | // camera init 74 | esp_err_t err = esp_camera_init(&config); 75 | if (err != ESP_OK) { 76 | ESP_LOGE(TAG, "Camera init failed with error 0x%x", err); 77 | return; 78 | } 79 | 80 | //drop down frame size for higher initial frame rate 81 | sensor_t * s = esp_camera_sensor_get(); 82 | s->set_framesize(s, FRAMESIZE_QVGA); 83 | } 84 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/dir_192612bb567615e1828468f80da02f9d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: /home/yehangyang/Documents/Gitlab/others/esp-face/face_detection/mtmn/include Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 46 |
47 |
48 |
49 |
include Directory Reference
50 |
51 |
52 | 53 | 55 | 56 | 57 | 58 | 59 |

54 | Files

file  face_detection_forward.h [code]
 
file  mtmn.h [code]
 
60 |
61 | 62 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/functions_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Data Fields - Variables 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 43 | 49 |
50 |
51 |   80 |
81 | 82 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/functions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Data Fields 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 43 | 49 |
50 |
51 |
Here is a list of all struct and union fields with links to the structures/unions they belong to:
80 |
81 | 82 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/structnet__config__t.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structnet__config__t}{}\section{net\+\_\+config\+\_\+t Struct Reference} 2 | \label{structnet__config__t}\index{net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}} 3 | 4 | 5 | {\ttfamily \#include $<$mtmn.\+h$>$} 6 | 7 | \subsection*{Data Fields} 8 | \begin{DoxyCompactItemize} 9 | \item 10 | \hyperlink{mtmn_8h_a9eb3d74ee60112199ec78344b3a4655e}{net\+\_\+type\+\_\+en} \hyperlink{structnet__config__t_a8f4c2af8911d60345894c9b1cd728a81}{net\+\_\+type} 11 | \item 12 | char $\ast$ \hyperlink{structnet__config__t_a8505c513bc640d1f69e5f76fb32b24a8}{file\+\_\+name} 13 | \item 14 | int \hyperlink{structnet__config__t_aac374e320caaadeca4874add33b62af2}{w} 15 | \item 16 | int \hyperlink{structnet__config__t_a16611451551e3d15916bae723c3f59f7}{h} 17 | \item 18 | float \hyperlink{structnet__config__t_ace479cfe5e33dac6639cf88d0551b58c}{score\+\_\+threshold} 19 | \item 20 | float \hyperlink{structnet__config__t_a363bfab5175aae09f069a69ff5072f2c}{nms\+\_\+threshold} 21 | \end{DoxyCompactItemize} 22 | 23 | 24 | \subsection{Field Documentation} 25 | \index{net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}!file\+\_\+name@{file\+\_\+name}} 26 | \index{file\+\_\+name@{file\+\_\+name}!net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}} 27 | \subsubsection[{\texorpdfstring{file\+\_\+name}{file_name}}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ file\+\_\+name}\hypertarget{structnet__config__t_a8505c513bc640d1f69e5f76fb32b24a8}{}\label{structnet__config__t_a8505c513bc640d1f69e5f76fb32b24a8} 28 | \index{net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}!h@{h}} 29 | \index{h@{h}!net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}} 30 | \subsubsection[{\texorpdfstring{h}{h}}]{\setlength{\rightskip}{0pt plus 5cm}int h}\hypertarget{structnet__config__t_a16611451551e3d15916bae723c3f59f7}{}\label{structnet__config__t_a16611451551e3d15916bae723c3f59f7} 31 | \index{net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}!net\+\_\+type@{net\+\_\+type}} 32 | \index{net\+\_\+type@{net\+\_\+type}!net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}} 33 | \subsubsection[{\texorpdfstring{net\+\_\+type}{net_type}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf net\+\_\+type\+\_\+en} net\+\_\+type}\hypertarget{structnet__config__t_a8f4c2af8911d60345894c9b1cd728a81}{}\label{structnet__config__t_a8f4c2af8911d60345894c9b1cd728a81} 34 | \index{net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}!nms\+\_\+threshold@{nms\+\_\+threshold}} 35 | \index{nms\+\_\+threshold@{nms\+\_\+threshold}!net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}} 36 | \subsubsection[{\texorpdfstring{nms\+\_\+threshold}{nms_threshold}}]{\setlength{\rightskip}{0pt plus 5cm}float nms\+\_\+threshold}\hypertarget{structnet__config__t_a363bfab5175aae09f069a69ff5072f2c}{}\label{structnet__config__t_a363bfab5175aae09f069a69ff5072f2c} 37 | \index{net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}!score\+\_\+threshold@{score\+\_\+threshold}} 38 | \index{score\+\_\+threshold@{score\+\_\+threshold}!net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}} 39 | \subsubsection[{\texorpdfstring{score\+\_\+threshold}{score_threshold}}]{\setlength{\rightskip}{0pt plus 5cm}float score\+\_\+threshold}\hypertarget{structnet__config__t_ace479cfe5e33dac6639cf88d0551b58c}{}\label{structnet__config__t_ace479cfe5e33dac6639cf88d0551b58c} 40 | \index{net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}!w@{w}} 41 | \index{w@{w}!net\+\_\+config\+\_\+t@{net\+\_\+config\+\_\+t}} 42 | \subsubsection[{\texorpdfstring{w}{w}}]{\setlength{\rightskip}{0pt plus 5cm}int w}\hypertarget{structnet__config__t_aac374e320caaadeca4874add33b62af2}{}\label{structnet__config__t_aac374e320caaadeca4874add33b62af2} 43 | 44 | 45 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 46 | \item 47 | /home/yehangyang/\+Documents/\+Gitlab/others/esp-\/face/face\+\_\+detection/mtmn/include/\hyperlink{mtmn_8h}{mtmn.\+h}\end{DoxyCompactItemize} 48 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/globals.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: Globals 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 51 |
52 |
53 |
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
82 |
83 | 84 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /components/esp-face/face_recognition/include/fr_forward.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if __cplusplus 4 | extern "C" 5 | { 6 | #endif 7 | 8 | #include "image_util.h" 9 | #include "dl_lib.h" 10 | #include "frmn.h" 11 | 12 | #define FACE_WIDTH 56 13 | #define FACE_HEIGHT 56 14 | #define FACE_ID_SIZE 512 15 | #define FACE_REC_THRESHOLD 0.5 16 | 17 | #define LEFT_EYE_X 0 18 | #define LEFT_EYE_Y 1 19 | #define RIGHT_EYE_X 6 20 | #define RIGHT_EYE_Y 7 21 | #define NOSE_X 4 22 | #define NOSE_Y 5 23 | 24 | #define EYE_DIST_SET 16.5f 25 | #define NOSE_EYE_RATIO_THRES_MIN 0.49f 26 | #define NOSE_EYE_RATIO_THRES_MAX 2.04f 27 | 28 | #define FLASH_INFO_FLAG 12138 29 | #define FLASH_PARTITION_NAME "fr" 30 | 31 | /** 32 | * @brief HTTP Client events data 33 | */ 34 | typedef struct 35 | { 36 | uint8_t head; /*!< head index of the id list */ 37 | uint8_t tail; /*!< tail index of the id list */ 38 | uint8_t count; /*!< number of enrolled ids */ 39 | uint8_t size; /*!< max len of id list */ 40 | uint8_t confirm_times; /*!< images needed for one enrolling */ 41 | dl_matrix3d_t **id_list; /*!< stores face id vectors */ 42 | } face_id_list; 43 | 44 | 45 | /** 46 | * @brief Initialize face id list 47 | * 48 | * @param l Face id list 49 | * @param size Size of list, one list contains one vector 50 | * @param confirm_times Enroll times for one id 51 | * @return dl_matrix3du_t* Size: 1xFACE_WIDTHxFACE_HEIGHTx3 52 | */ 53 | void face_id_init(face_id_list *l, uint8_t size, uint8_t confirm_times); 54 | 55 | /** 56 | * @brief Alloc memory for aligned face. 57 | * 58 | * @return dl_matrix3du_t* Size: 1xFACE_WIDTHxFACE_HEIGHTx3 59 | */ 60 | dl_matrix3du_t *aligned_face_alloc(); 61 | 62 | /** 63 | * @brief Align detected face to average face according to landmark 64 | * 65 | * @param onet_boxes Output of MTMN with box and landmark 66 | * @param src Image matrix, rgb888 format 67 | * @param dest Output image 68 | * @return ESP_OK Input face is good for recognition 69 | * @return ESP_FAIL Input face is not good for recognition 70 | */ 71 | int8_t align_face(box_array_t *onet_boxes, 72 | dl_matrix3du_t *src, 73 | dl_matrix3du_t *dest); 74 | 75 | /** 76 | * @brief Add src_id to dest_id 77 | * 78 | * @param dest_id 79 | * @param src_id 80 | */ 81 | void add_face_id(dl_matrix3d_t *dest_id, 82 | dl_matrix3d_t *src_id); 83 | 84 | /** 85 | * @brief Match face with the id_list, and return matched_id. 86 | * 87 | * @param algined_face An aligned face 88 | * @param id_list An ID list 89 | * @return int8_t Matched face id 90 | */ 91 | int8_t recognize_face(face_id_list *l, 92 | dl_matrix3du_t *algined_face); 93 | 94 | /** 95 | * @brief Produce face id according to the input aligned face, and save it to dest_id. 96 | * 97 | * @param l face id list 98 | * @param aligned_face An aligned face 99 | * @param enroll_confirm_times Confirm times for each face id enrollment 100 | * @return -1 Wrong input enroll_confirm_times 101 | * @return 0 Enrollment finish 102 | * @return >=1 The left piece of aligned faces should be input 103 | */ 104 | int8_t enroll_face(face_id_list *l, 105 | dl_matrix3du_t *aligned_face); 106 | 107 | /** 108 | * @brief Alloc memory for aligned face. 109 | * 110 | * @param l face id list 111 | * @return uint8_t left count 112 | */ 113 | uint8_t delete_face(face_id_list *l); 114 | #if __cplusplus 115 | } 116 | #endif 117 | -------------------------------------------------------------------------------- /components/esp32-camera/conversions/esp_jpg_decode.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #include "esp_jpg_decode.h" 15 | #include "rom/tjpgd.h" 16 | 17 | #if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) 18 | #include "esp32-hal-log.h" 19 | #define TAG "" 20 | #else 21 | #include "esp_log.h" 22 | static const char* TAG = "esp_jpg_decode"; 23 | #endif 24 | 25 | typedef struct { 26 | jpg_scale_t scale; 27 | jpg_reader_cb reader; 28 | jpg_writer_cb writer; 29 | void * arg; 30 | size_t len; 31 | size_t index; 32 | } esp_jpg_decoder_t; 33 | 34 | static const char * jd_errors[] = { 35 | "Succeeded", 36 | "Interrupted by output function", 37 | "Device error or wrong termination of input stream", 38 | "Insufficient memory pool for the image", 39 | "Insufficient stream input buffer", 40 | "Parameter error", 41 | "Data format error", 42 | "Right format but not supported", 43 | "Not supported JPEG standard" 44 | }; 45 | 46 | static uint32_t _jpg_write(JDEC *decoder, void *bitmap, JRECT *rect) 47 | { 48 | uint16_t x = rect->left; 49 | uint16_t y = rect->top; 50 | uint16_t w = rect->right + 1 - x; 51 | uint16_t h = rect->bottom + 1 - y; 52 | uint8_t *data = (uint8_t *)bitmap; 53 | 54 | esp_jpg_decoder_t * jpeg = (esp_jpg_decoder_t *)decoder->device; 55 | 56 | if (jpeg->writer) { 57 | return jpeg->writer(jpeg->arg, x, y, w, h, data); 58 | } 59 | return 0; 60 | } 61 | 62 | static uint32_t _jpg_read(JDEC *decoder, uint8_t *buf, uint32_t len) 63 | { 64 | esp_jpg_decoder_t * jpeg = (esp_jpg_decoder_t *)decoder->device; 65 | if (jpeg->len && len > (jpeg->len - jpeg->index)) { 66 | len = jpeg->len - jpeg->index; 67 | } 68 | if (len) { 69 | len = jpeg->reader(jpeg->arg, jpeg->index, buf, len); 70 | if (!len) { 71 | ESP_LOGE(TAG, "Read Fail at %u/%u", jpeg->index, jpeg->len); 72 | } 73 | jpeg->index += len; 74 | } 75 | return len; 76 | } 77 | 78 | esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg) 79 | { 80 | static uint8_t work[3100]; 81 | JDEC decoder; 82 | esp_jpg_decoder_t jpeg; 83 | 84 | jpeg.len = len; 85 | jpeg.reader = reader; 86 | jpeg.writer = writer; 87 | jpeg.arg = arg; 88 | jpeg.scale = scale; 89 | jpeg.index = 0; 90 | 91 | JRESULT jres = jd_prepare(&decoder, _jpg_read, work, 3100, &jpeg); 92 | if(jres != JDR_OK){ 93 | ESP_LOGE(TAG, "JPG Header Parse Failed! %s", jd_errors[jres]); 94 | return ESP_FAIL; 95 | } 96 | 97 | uint16_t output_width = decoder.width / (1 << (uint8_t)(jpeg.scale)); 98 | uint16_t output_height = decoder.height / (1 << (uint8_t)(jpeg.scale)); 99 | 100 | //output start 101 | writer(arg, 0, 0, output_width, output_height, NULL); 102 | //output write 103 | jres = jd_decomp(&decoder, _jpg_write, (uint8_t)jpeg.scale); 104 | //output end 105 | writer(arg, output_width, output_height, output_width, output_height, NULL); 106 | 107 | if (jres != JDR_OK) { 108 | ESP_LOGE(TAG, "JPG Decompression Failed! %s", jd_errors[jres]); 109 | return ESP_FAIL; 110 | } 111 | //check if all data has been consumed. 112 | if (len && jpeg.index < len) { 113 | _jpg_read(&decoder, NULL, len - jpeg.index); 114 | } 115 | 116 | return ESP_OK; 117 | } 118 | 119 | -------------------------------------------------------------------------------- /components/esp-face/lib/include/mtmn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ESPRESSIF MIT License 3 | * 4 | * Copyright (c) 2018 5 | * 6 | * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, 7 | * it is free of charge, to any person obtaining a copy of this software and associated 8 | * documentation files (the "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished 11 | * to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or 14 | * substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | #pragma once 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | #include "dl_lib.h" 31 | 32 | typedef enum 33 | { 34 | PNET = 0, /// P-Net 35 | RNET = 1, /// R-Net 36 | ONET = 2, /// O-Net 37 | } net_type_en; 38 | 39 | typedef struct 40 | { 41 | float score; /// score threshold for filter candidates by score 42 | float nms; /// nms threshold for nms process 43 | int candidate_number; /// candidate number limitation for each net 44 | } threshold_config_t; 45 | 46 | typedef struct 47 | { 48 | net_type_en net_type; /// net type 49 | char *file_name; /// net name 50 | int w; /// net width 51 | int h; /// net height 52 | threshold_config_t threshold; /// threshold of net 53 | } net_config_t; 54 | 55 | typedef struct 56 | { 57 | float min_face; /// the minimum size of face can be detected 58 | float pyramid; /// the pyramid scale 59 | threshold_config_t p_threshold; /// score, nms and candidate threshold of pnet 60 | threshold_config_t r_threshold; /// score, nms and candidate threshold of rnet 61 | threshold_config_t o_threshold; /// score, nms and candidate threshold of onet 62 | } mtmn_config_t; 63 | 64 | typedef struct 65 | { 66 | dl_matrix3d_t *category; 67 | dl_matrix3d_t *offset; 68 | dl_matrix3d_t *landmark; 69 | } mtmn_net_t; 70 | 71 | /** 72 | * @brief Forward the pnet process, coarse detection 73 | * 74 | * @param in Image matrix, rgb888 format, size is 320x240 75 | * @return Scores for every pixel, and box offset with respect. 76 | */ 77 | mtmn_net_t *pnet(dl_matrix3du_t *in); 78 | 79 | /** 80 | * @brief Forward the rnet process, fine determine the boxes from pnet 81 | * 82 | * @param in Image matrix, rgb888 format 83 | * @param threshold Score threshold to detect human face 84 | * @return Scores for every box, and box offset with respect. 85 | */ 86 | mtmn_net_t *rnet_with_score_verify(dl_matrix3du_t *in, float threshold); 87 | 88 | /** 89 | * @brief Forward the onet process, fine determine the boxes from rnet 90 | * 91 | * @param in Image matrix, rgb888 format 92 | * @param threshold Score threshold to detect human face 93 | * @return Scores for every box, box offset, and landmark with respect. 94 | */ 95 | mtmn_net_t *onet_with_score_verify(dl_matrix3du_t *in, float threshold); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/files.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: File List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 |
43 |
44 |
45 |
File List
46 |
47 |
48 |
Here is a list of all files with brief descriptions:
49 |
[detail level 1234]
50 | 51 | 52 | 53 | 54 | 55 |
  face_detection
  mtmn
  include
 face_detection_forward.h
 mtmn.h
56 |
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /components/esp-face/face_recognition/fr_flash.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "esp_log.h" 5 | #include "fr_flash.h" 6 | #include "freertos/FreeRTOS.h" 7 | #include "rom/ets_sys.h" 8 | #include "esp_partition.h" 9 | 10 | static const char *TAG = "fr_flash"; 11 | int8_t enroll_face_id_to_flash(face_id_list *l, 12 | dl_matrix3du_t *aligned_face) 13 | { 14 | int8_t left_sample = enroll_face(l, aligned_face); 15 | if (left_sample == 0) 16 | { 17 | const esp_partition_t *pt = esp_partition_find_first(FR_FLASH_TYPE, FR_FLASH_SUBTYPE, FR_FLASH_PARTITION_NAME); 18 | if (pt == NULL){ 19 | ESP_LOGE(TAG, "Not found"); 20 | return -2; 21 | } 22 | 23 | const int block_len = FACE_ID_SIZE * sizeof(float); 24 | const int block_num = (4096 + block_len - 1) / block_len; 25 | float *backup_buf = (float *)calloc(1, block_len); 26 | int flash_info_flag = FR_FLASH_INFO_FLAG; 27 | uint8_t enroll_id_idx = (l->tail - 1) % l->size; 28 | 29 | if(enroll_id_idx % block_num == 0) 30 | { 31 | // save the other block TODO: if block != 2 32 | esp_partition_read(pt, 4096 + (enroll_id_idx + 1) * block_len, backup_buf, block_len); 33 | 34 | esp_partition_erase_range(pt, 4096 + enroll_id_idx * block_len, 4096); 35 | 36 | esp_partition_write(pt, 4096 + enroll_id_idx * block_len, l->id_list[enroll_id_idx]->item, block_len); 37 | esp_partition_write(pt, 4096 + (enroll_id_idx + 1) * block_len, backup_buf, block_len); 38 | } 39 | else 40 | { 41 | // save the other block TODO: if block != 2 42 | esp_partition_read(pt, 4096 + (enroll_id_idx - 1) * block_len, backup_buf, block_len); 43 | 44 | esp_partition_erase_range(pt, 4096 + (enroll_id_idx - 1) * block_len, 4096); 45 | 46 | esp_partition_write(pt, 4096 + (enroll_id_idx - 1) * block_len, backup_buf, block_len); 47 | esp_partition_write(pt, 4096 + enroll_id_idx * block_len, l->id_list[enroll_id_idx]->item, block_len); 48 | } 49 | 50 | esp_partition_erase_range(pt, 0, 4096); 51 | esp_partition_write(pt, 0, &flash_info_flag, sizeof(int)); 52 | esp_partition_write(pt, sizeof(int), l, sizeof(face_id_list)); 53 | 54 | return 0; 55 | } 56 | 57 | return left_sample; 58 | } 59 | 60 | int8_t read_face_id_from_flash(face_id_list *l) 61 | { 62 | const esp_partition_t *pt = esp_partition_find_first(FR_FLASH_TYPE, FR_FLASH_SUBTYPE, FR_FLASH_PARTITION_NAME); 63 | if (pt == NULL){ 64 | ESP_LOGE(TAG, "Not found"); 65 | return -1; 66 | } 67 | 68 | int flash_info_flag = 0; 69 | 70 | esp_partition_read(pt, 0, &flash_info_flag, sizeof(int)); 71 | if(flash_info_flag != FR_FLASH_INFO_FLAG) 72 | { 73 | ESP_LOGE(TAG, "No ID Infomation"); 74 | return -2; 75 | } 76 | 77 | uint8_t size = l->size; 78 | uint8_t confirm_times = l->confirm_times; 79 | dl_matrix3d_t **id_list = l->id_list; 80 | 81 | esp_partition_read(pt, sizeof(int), l, sizeof(face_id_list)); 82 | const int block_len = FACE_ID_SIZE * sizeof(float); 83 | 84 | assert(l->size == size); 85 | assert(l->confirm_times == confirm_times); 86 | 87 | for(int i = 0; i < l->count; i++) 88 | { 89 | uint8_t head = (l->head + i) % size; 90 | id_list[head] = dl_matrix3d_alloc(1, 1, 1, FACE_ID_SIZE); 91 | esp_partition_read(pt, 4096 + head * block_len, id_list[head]->item, block_len); 92 | } 93 | 94 | l->id_list = id_list; 95 | 96 | return l->count; 97 | } 98 | 99 | int8_t delete_face_id_in_flash(face_id_list *l) 100 | { 101 | delete_face(l); 102 | 103 | const esp_partition_t *pt = esp_partition_find_first(FR_FLASH_TYPE, FR_FLASH_SUBTYPE, FR_FLASH_PARTITION_NAME); 104 | if (pt == NULL){ 105 | ESP_LOGE(TAG, "Not found"); 106 | return -1; 107 | } 108 | 109 | int flash_info_flag = 0; 110 | esp_partition_read(pt, 0, &flash_info_flag, sizeof(int)); 111 | if((flash_info_flag != FR_FLASH_INFO_FLAG)) 112 | { 113 | ESP_LOGE(TAG, "No ID Infomation"); 114 | return -2; 115 | } 116 | 117 | esp_partition_erase_range(pt, 0, 4096); 118 | esp_partition_write(pt, 0, &flash_info_flag, sizeof(int)); 119 | esp_partition_write(pt, sizeof(int), l, sizeof(face_id_list)); 120 | return l->count; 121 | } 122 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/latex/refman.tex: -------------------------------------------------------------------------------- 1 | \documentclass[twoside]{book} 2 | 3 | % Packages required by doxygen 4 | \usepackage{fixltx2e} 5 | \usepackage{calc} 6 | \usepackage{doxygen} 7 | \usepackage[export]{adjustbox} % also loads graphicx 8 | \usepackage{graphicx} 9 | \usepackage[utf8]{inputenc} 10 | \usepackage{makeidx} 11 | \usepackage{multicol} 12 | \usepackage{multirow} 13 | \PassOptionsToPackage{warn}{textcomp} 14 | \usepackage{textcomp} 15 | \usepackage[nointegrals]{wasysym} 16 | \usepackage[table]{xcolor} 17 | 18 | % Font selection 19 | \usepackage[T1]{fontenc} 20 | \usepackage[scaled=.90]{helvet} 21 | \usepackage{courier} 22 | \usepackage{amssymb} 23 | \usepackage{sectsty} 24 | \renewcommand{\familydefault}{\sfdefault} 25 | \allsectionsfont{% 26 | \fontseries{bc}\selectfont% 27 | \color{darkgray}% 28 | } 29 | \renewcommand{\DoxyLabelFont}{% 30 | \fontseries{bc}\selectfont% 31 | \color{darkgray}% 32 | } 33 | \newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} 34 | 35 | % Page & text layout 36 | \usepackage{geometry} 37 | \geometry{% 38 | a4paper,% 39 | top=2.5cm,% 40 | bottom=2.5cm,% 41 | left=2.5cm,% 42 | right=2.5cm% 43 | } 44 | \tolerance=750 45 | \hfuzz=15pt 46 | \hbadness=750 47 | \setlength{\emergencystretch}{15pt} 48 | \setlength{\parindent}{0cm} 49 | \setlength{\parskip}{3ex plus 2ex minus 2ex} 50 | \makeatletter 51 | \renewcommand{\paragraph}{% 52 | \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{% 53 | \normalfont\normalsize\bfseries\SS@parafont% 54 | }% 55 | } 56 | \renewcommand{\subparagraph}{% 57 | \@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{% 58 | \normalfont\normalsize\bfseries\SS@subparafont% 59 | }% 60 | } 61 | \makeatother 62 | 63 | % Headers & footers 64 | \usepackage{fancyhdr} 65 | \pagestyle{fancyplain} 66 | \fancyhead[LE]{\fancyplain{}{\bfseries\thepage}} 67 | \fancyhead[CE]{\fancyplain{}{}} 68 | \fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}} 69 | \fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}} 70 | \fancyhead[CO]{\fancyplain{}{}} 71 | \fancyhead[RO]{\fancyplain{}{\bfseries\thepage}} 72 | \fancyfoot[LE]{\fancyplain{}{}} 73 | \fancyfoot[CE]{\fancyplain{}{}} 74 | \fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} 75 | \fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} 76 | \fancyfoot[CO]{\fancyplain{}{}} 77 | \fancyfoot[RO]{\fancyplain{}{}} 78 | \renewcommand{\footrulewidth}{0.4pt} 79 | \renewcommand{\chaptermark}[1]{% 80 | \markboth{#1}{}% 81 | } 82 | \renewcommand{\sectionmark}[1]{% 83 | \markright{\thesection\ #1}% 84 | } 85 | 86 | % Indices & bibliography 87 | \usepackage{natbib} 88 | \usepackage[titles]{tocloft} 89 | \setcounter{tocdepth}{3} 90 | \setcounter{secnumdepth}{5} 91 | \makeindex 92 | 93 | % Hyperlinks (required, but should be loaded last) 94 | \usepackage{ifpdf} 95 | \ifpdf 96 | \usepackage[pdftex,pagebackref=true]{hyperref} 97 | \else 98 | \usepackage[ps2pdf,pagebackref=true]{hyperref} 99 | \fi 100 | \hypersetup{% 101 | colorlinks=true,% 102 | linkcolor=blue,% 103 | citecolor=blue,% 104 | unicode% 105 | } 106 | 107 | % Custom commands 108 | \newcommand{\clearemptydoublepage}{% 109 | \newpage{\pagestyle{empty}\cleardoublepage}% 110 | } 111 | 112 | \usepackage{caption} 113 | \captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top} 114 | 115 | %===== C O N T E N T S ===== 116 | 117 | \begin{document} 118 | 119 | % Titlepage & ToC 120 | \hypersetup{pageanchor=false, 121 | bookmarksnumbered=true, 122 | pdfencoding=unicode 123 | } 124 | \pagenumbering{roman} 125 | \begin{titlepage} 126 | \vspace*{7cm} 127 | \begin{center}% 128 | {\Large mtmn }\\ 129 | \vspace*{1cm} 130 | {\large Generated by Doxygen 1.8.11}\\ 131 | \end{center} 132 | \end{titlepage} 133 | \clearemptydoublepage 134 | \tableofcontents 135 | \clearemptydoublepage 136 | \pagenumbering{arabic} 137 | \hypersetup{pageanchor=true} 138 | 139 | %--- Begin generated contents --- 140 | \chapter{Data Structure Index} 141 | \input{annotated} 142 | \chapter{File Index} 143 | \input{files} 144 | \chapter{Data Structure Documentation} 145 | \input{structmtmn__net__t} 146 | \input{structnet__config__t} 147 | \chapter{File Documentation} 148 | \input{face__detection__forward_8h} 149 | \input{mtmn_8h} 150 | %--- End generated contents --- 151 | 152 | % Index 153 | \backmatter 154 | \newpage 155 | \phantomsection 156 | \clearemptydoublepage 157 | \addcontentsline{toc}{chapter}{Index} 158 | \printindex 159 | 160 | \end{document} 161 | -------------------------------------------------------------------------------- /components/esp32-camera/driver/include/sensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * Sensor abstraction layer. 7 | * 8 | */ 9 | #ifndef __SENSOR_H__ 10 | #define __SENSOR_H__ 11 | #include 12 | 13 | #define OV9650_PID (0x96) 14 | #define OV2640_PID (0x26) 15 | #define OV7725_PID (0x77) 16 | 17 | typedef enum { 18 | PIXFORMAT_RGB565, // 2BPP/RGB565 19 | PIXFORMAT_YUV422, // 2BPP/YUV422 20 | PIXFORMAT_GRAYSCALE, // 1BPP/GRAYSCALE 21 | PIXFORMAT_JPEG, // JPEG/COMPRESSED 22 | PIXFORMAT_RGB888, // 3BPP/RGB888 23 | } pixformat_t; 24 | 25 | typedef enum { 26 | FRAMESIZE_QQVGA, // 160x120 27 | FRAMESIZE_QQVGA2, // 128x160 28 | FRAMESIZE_QCIF, // 176x144 29 | FRAMESIZE_HQVGA, // 240x176 30 | FRAMESIZE_QVGA, // 320x240 31 | FRAMESIZE_CIF, // 400x296 32 | FRAMESIZE_VGA, // 640x480 33 | FRAMESIZE_SVGA, // 800x600 34 | FRAMESIZE_XGA, // 1024x768 35 | FRAMESIZE_SXGA, // 1280x1024 36 | FRAMESIZE_UXGA, // 1600x1200 37 | } framesize_t; 38 | 39 | typedef enum { 40 | GAINCEILING_2X, 41 | GAINCEILING_4X, 42 | GAINCEILING_8X, 43 | GAINCEILING_16X, 44 | GAINCEILING_32X, 45 | GAINCEILING_64X, 46 | GAINCEILING_128X, 47 | } gainceiling_t; 48 | 49 | typedef struct { 50 | uint8_t MIDH; 51 | uint8_t MIDL; 52 | uint8_t PID; 53 | uint8_t VER; 54 | } sensor_id_t; 55 | 56 | typedef struct { 57 | framesize_t framesize;//0 - 10 58 | uint8_t quality;//0 - 63 59 | int8_t brightness;//-2 - 2 60 | int8_t contrast;//-2 - 2 61 | int8_t saturation;//-2 - 2 62 | uint8_t special_effect;//0 - 6 63 | uint8_t wb_mode;//0 - 4 64 | uint8_t awb; 65 | uint8_t awb_gain; 66 | uint8_t aec; 67 | uint8_t aec2; 68 | int8_t ae_level;//-2 - 2 69 | uint16_t aec_value;//0 - 1200 70 | uint8_t agc; 71 | uint8_t agc_gain;//0 - 30 72 | uint8_t gainceiling;//0 - 6 73 | uint8_t bpc; 74 | uint8_t wpc; 75 | uint8_t raw_gma; 76 | uint8_t lenc; 77 | uint8_t hmirror; 78 | uint8_t vflip; 79 | uint8_t dcw; 80 | uint8_t colorbar; 81 | } camera_status_t; 82 | 83 | typedef struct _sensor sensor_t; 84 | typedef struct _sensor { 85 | sensor_id_t id; // Sensor ID. 86 | uint8_t slv_addr; // Sensor I2C slave address. 87 | pixformat_t pixformat; 88 | camera_status_t status; 89 | int xclk_freq_hz; 90 | 91 | // Sensor function pointers 92 | int (*init_status) (sensor_t *sensor); 93 | int (*reset) (sensor_t *sensor); 94 | int (*set_pixformat) (sensor_t *sensor, pixformat_t pixformat); 95 | int (*set_framesize) (sensor_t *sensor, framesize_t framesize); 96 | int (*set_contrast) (sensor_t *sensor, int level); 97 | int (*set_brightness) (sensor_t *sensor, int level); 98 | int (*set_saturation) (sensor_t *sensor, int level); 99 | int (*set_gainceiling) (sensor_t *sensor, gainceiling_t gainceiling); 100 | int (*set_quality) (sensor_t *sensor, int quality); 101 | int (*set_colorbar) (sensor_t *sensor, int enable); 102 | int (*set_whitebal) (sensor_t *sensor, int enable); 103 | int (*set_gain_ctrl) (sensor_t *sensor, int enable); 104 | int (*set_exposure_ctrl) (sensor_t *sensor, int enable); 105 | int (*set_hmirror) (sensor_t *sensor, int enable); 106 | int (*set_vflip) (sensor_t *sensor, int enable); 107 | 108 | int (*set_aec2) (sensor_t *sensor, int enable); 109 | int (*set_awb_gain) (sensor_t *sensor, int enable); 110 | int (*set_agc_gain) (sensor_t *sensor, int gain); 111 | int (*set_aec_value) (sensor_t *sensor, int gain); 112 | 113 | int (*set_special_effect) (sensor_t *sensor, int effect); 114 | int (*set_wb_mode) (sensor_t *sensor, int mode); 115 | int (*set_ae_level) (sensor_t *sensor, int level); 116 | 117 | int (*set_dcw) (sensor_t *sensor, int enable); 118 | int (*set_bpc) (sensor_t *sensor, int enable); 119 | int (*set_wpc) (sensor_t *sensor, int enable); 120 | 121 | int (*set_raw_gma) (sensor_t *sensor, int enable); 122 | int (*set_lenc) (sensor_t *sensor, int enable); 123 | } sensor_t; 124 | 125 | // Resolution table (in camera.c) 126 | extern const int resolution[][2]; 127 | 128 | #endif /* __SENSOR_H__ */ 129 | -------------------------------------------------------------------------------- /main/include/app_camera.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ESPRESSIF MIT License 3 | * 4 | * Copyright (c) 2017 5 | * 6 | * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, 7 | * it is free of charge, to any person obtaining a copy of this software and associated 8 | * documentation files (the "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished 11 | * to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or 14 | * substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | #ifndef _APP_CAMERA_H_ 25 | #define _APP_CAMERA_H_ 26 | 27 | #if CONFIG_CAMERA_MODEL_WROVER_KIT 28 | #define PWDN_GPIO_NUM -1 29 | #define RESET_GPIO_NUM -1 30 | #define XCLK_GPIO_NUM 21 31 | #define SIOD_GPIO_NUM 26 32 | #define SIOC_GPIO_NUM 27 33 | 34 | #define Y9_GPIO_NUM 35 35 | #define Y8_GPIO_NUM 34 36 | #define Y7_GPIO_NUM 39 37 | #define Y6_GPIO_NUM 36 38 | #define Y5_GPIO_NUM 19 39 | #define Y4_GPIO_NUM 18 40 | #define Y3_GPIO_NUM 5 41 | #define Y2_GPIO_NUM 4 42 | #define VSYNC_GPIO_NUM 25 43 | #define HREF_GPIO_NUM 23 44 | #define PCLK_GPIO_NUM 22 45 | 46 | #elif CONFIG_CAMERA_MODEL_M5STACK 47 | #define PWDN_GPIO_NUM -1 48 | #define RESET_GPIO_NUM 15 49 | #define XCLK_GPIO_NUM 27 50 | #define SIOD_GPIO_NUM 25 51 | #define SIOC_GPIO_NUM 23 52 | 53 | #define Y9_GPIO_NUM 19 54 | #define Y8_GPIO_NUM 36 55 | #define Y7_GPIO_NUM 18 56 | #define Y6_GPIO_NUM 39 57 | #define Y5_GPIO_NUM 5 58 | #define Y4_GPIO_NUM 34 59 | #define Y3_GPIO_NUM 35 60 | #define Y2_GPIO_NUM 17 61 | #define VSYNC_GPIO_NUM 22 62 | #define HREF_GPIO_NUM 26 63 | #define PCLK_GPIO_NUM 21 64 | 65 | #elif CONFIG_CAMERA_MODEL_M5STACK_PSRAM 66 | #define PWDN_GPIO_NUM -1 67 | #define RESET_GPIO_NUM 15 68 | #define XCLK_GPIO_NUM 27 69 | #define SIOD_GPIO_NUM 25 70 | #define SIOC_GPIO_NUM 23 71 | 72 | #define Y9_GPIO_NUM 19 73 | #define Y8_GPIO_NUM 36 74 | #define Y7_GPIO_NUM 18 75 | #define Y6_GPIO_NUM 39 76 | #define Y5_GPIO_NUM 5 77 | #define Y4_GPIO_NUM 34 78 | #define Y3_GPIO_NUM 35 79 | #define Y2_GPIO_NUM 32 80 | #define VSYNC_GPIO_NUM 22 81 | #define HREF_GPIO_NUM 26 82 | #define PCLK_GPIO_NUM 21 83 | 84 | #elif CONFIG_CAMERA_MODEL_AI_THINKER 85 | #define PWDN_GPIO_NUM 32 86 | #define RESET_GPIO_NUM -1 87 | #define XCLK_GPIO_NUM 0 88 | #define SIOD_GPIO_NUM 26 89 | #define SIOC_GPIO_NUM 27 90 | 91 | #define Y9_GPIO_NUM 35 92 | #define Y8_GPIO_NUM 34 93 | #define Y7_GPIO_NUM 39 94 | #define Y6_GPIO_NUM 36 95 | #define Y5_GPIO_NUM 21 96 | #define Y4_GPIO_NUM 19 97 | #define Y3_GPIO_NUM 18 98 | #define Y2_GPIO_NUM 5 99 | #define VSYNC_GPIO_NUM 25 100 | #define HREF_GPIO_NUM 23 101 | #define PCLK_GPIO_NUM 22 102 | 103 | 104 | #elif CONFIG_CAMERA_MODEL_CUSTOM 105 | #define PWDN_GPIO_NUM CONFIG_CAMERA_PIN_PWDN 106 | #define RESET_GPIO_NUM CONFIG_CAMERA_PIN_RESET 107 | #define XCLK_GPIO_NUM CONFIG_CAMERA_PIN_XCLK 108 | #define SIOD_GPIO_NUM CONFIG_CAMERA_PIN_SIOD 109 | #define SIOC_GPIO_NUM CONFIG_CAMERA_PIN_SIOC 110 | 111 | #define Y9_GPIO_NUM CONFIG_CAMERA_PIN_Y9 112 | #define Y8_GPIO_NUM CONFIG_CAMERA_PIN_Y8 113 | #define Y7_GPIO_NUM CONFIG_CAMERA_PIN_Y7 114 | #define Y6_GPIO_NUM CONFIG_CAMERA_PIN_Y6 115 | #define Y5_GPIO_NUM CONFIG_CAMERA_PIN_Y5 116 | #define Y4_GPIO_NUM CONFIG_CAMERA_PIN_Y4 117 | #define Y3_GPIO_NUM CONFIG_CAMERA_PIN_Y3 118 | #define Y2_GPIO_NUM CONFIG_CAMERA_PIN_Y2 119 | #define VSYNC_GPIO_NUM CONFIG_CAMERA_PIN_VSYNC 120 | #define HREF_GPIO_NUM CONFIG_CAMERA_PIN_HREF 121 | #define PCLK_GPIO_NUM CONFIG_CAMERA_PIN_PCLK 122 | #endif 123 | 124 | #ifdef __cplusplus 125 | extern "C" { 126 | #endif 127 | 128 | void app_camera_main(); 129 | 130 | #ifdef __cplusplus 131 | } 132 | #endif 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Camera Web Server" 2 | 3 | menu "WiFi Settings" 4 | config ESP_WIFI_SSID 5 | string "WiFi STA SSID" 6 | default "" 7 | help 8 | WiFi SSID (network name) to connect to or empty for Off. 9 | 10 | config ESP_WIFI_PASSWORD 11 | string "WiFi STA Password" 12 | default "" 13 | help 14 | WiFi Password if WEP/WPA/WPA2 or empty if Open. 15 | 16 | config ESP_WIFI_AP_SSID 17 | string "WiFi AP SSID" 18 | default "ESP32-Camera" 19 | help 20 | AP SSID (network name) to create or empty for Off. 21 | 22 | config ESP_WIFI_AP_PASSWORD 23 | string "WiFi AP Password" 24 | default "" 25 | help 26 | AP password for WPA2 or empty for Open. 27 | 28 | config SERVER_IP 29 | string "IP address of server" 30 | default "192.168.4.1" 31 | 32 | config ESP_MAXIMUM_RETRY 33 | int "Maximum retry" 34 | default 5 35 | help 36 | Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really inexistent. 37 | endmenu 38 | 39 | menu "Camera Pins" 40 | choice CAMERA_MODEL 41 | bool "Select Camera Pinout" 42 | default CAMERA_MODEL_WROVER_KIT 43 | help 44 | Select Camera Pinout. 45 | 46 | config CAMERA_MODEL_WROVER_KIT 47 | bool "WROVER-KIT With OV2640 Module" 48 | config CAMERA_MODEL_M5STACK 49 | bool "M5Stack Camera" 50 | config CAMERA_MODEL_M5STACK_PSRAM 51 | bool "M5Stack Camera With PSRAM" 52 | config CAMERA_MODEL_AI_THINKER 53 | bool "ESP32-CAM by AI-Thinker" 54 | config CAMERA_MODEL_CUSTOM 55 | bool "Custom Camera Pinout" 56 | endchoice 57 | 58 | config CAMERA_PIN_PWDN 59 | depends on CAMERA_MODEL_CUSTOM 60 | int "Power Down pin" 61 | range -1 33 62 | default -1 63 | help 64 | Select Power Down pin or -1 for unmanaged. 65 | 66 | config CAMERA_PIN_RESET 67 | depends on CAMERA_MODEL_CUSTOM 68 | int "Reset pin" 69 | range -1 33 70 | default -1 71 | help 72 | Select Camera Reset pin or -1 for software reset. 73 | 74 | config CAMERA_PIN_XCLK 75 | depends on CAMERA_MODEL_CUSTOM 76 | int "XCLK pin" 77 | range 0 33 78 | default 21 79 | help 80 | Select Camera XCLK pin. 81 | 82 | config CAMERA_PIN_SIOD 83 | depends on CAMERA_MODEL_CUSTOM 84 | int "SIOD pin" 85 | range 0 33 86 | default 26 87 | help 88 | Select Camera SIOD pin. 89 | 90 | config CAMERA_PIN_SIOC 91 | depends on CAMERA_MODEL_CUSTOM 92 | int "SIOC pin" 93 | range 0 33 94 | default 27 95 | help 96 | Select Camera SIOC pin. 97 | 98 | config CAMERA_PIN_VSYNC 99 | depends on CAMERA_MODEL_CUSTOM 100 | int "VSYNC pin" 101 | range 0 39 102 | default 25 103 | help 104 | Select Camera VSYNC pin. 105 | 106 | config CAMERA_PIN_HREF 107 | depends on CAMERA_MODEL_CUSTOM 108 | int "HREF pin" 109 | range 0 39 110 | default 23 111 | help 112 | Select Camera HREF pin. 113 | 114 | config CAMERA_PIN_PCLK 115 | depends on CAMERA_MODEL_CUSTOM 116 | int "PCLK pin" 117 | range 0 39 118 | default 25 119 | help 120 | Select Camera PCLK pin. 121 | 122 | config CAMERA_PIN_Y2 123 | depends on CAMERA_MODEL_CUSTOM 124 | int "Y2 pin" 125 | range 0 39 126 | default 4 127 | help 128 | Select Camera Y2 pin. 129 | 130 | config CAMERA_PIN_Y3 131 | depends on CAMERA_MODEL_CUSTOM 132 | int "Y3 pin" 133 | range 0 39 134 | default 5 135 | help 136 | Select Camera Y3 pin. 137 | 138 | config CAMERA_PIN_Y4 139 | depends on CAMERA_MODEL_CUSTOM 140 | int "Y4 pin" 141 | range 0 39 142 | default 18 143 | help 144 | Select Camera Y4 pin. 145 | 146 | config CAMERA_PIN_Y5 147 | depends on CAMERA_MODEL_CUSTOM 148 | int "Y5 pin" 149 | range 0 39 150 | default 19 151 | help 152 | Select Camera Y5 pin. 153 | 154 | config CAMERA_PIN_Y6 155 | depends on CAMERA_MODEL_CUSTOM 156 | int "Y6 pin" 157 | range 0 39 158 | default 36 159 | help 160 | Select Camera Y6 pin. 161 | 162 | config CAMERA_PIN_Y7 163 | depends on CAMERA_MODEL_CUSTOM 164 | int "Y7 pin" 165 | range 0 39 166 | default 39 167 | help 168 | Select Camera Y7 pin. 169 | 170 | config CAMERA_PIN_Y8 171 | depends on CAMERA_MODEL_CUSTOM 172 | int "Y8 pin" 173 | range 0 39 174 | default 34 175 | help 176 | Select Camera Y8 pin. 177 | 178 | config CAMERA_PIN_Y9 179 | depends on CAMERA_MODEL_CUSTOM 180 | int "Y9 pin" 181 | range 0 39 182 | default 35 183 | help 184 | Select Camera Y9 pin. 185 | 186 | endmenu 187 | 188 | config ESP_FACE_DETECT_ENABLED 189 | bool "ESP-WHO Face Detection" 190 | default n 191 | help 192 | Enables ESP-WHO Face Detection through the web interface. 193 | 194 | config ESP_FACE_RECOGNITION_ENABLED 195 | bool "ESP-WHO Face Recognition" 196 | depends on ESP_FACE_DETECT_ENABLED 197 | default n 198 | help 199 | Enables ESP-WHO Face Recognition through the web interface. 200 | 201 | endmenu 202 | -------------------------------------------------------------------------------- /main/build/CMakeFiles/3.11.1/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "C:/msys32/usr/bin/c++.exe") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "7.3.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | 14 | set(CMAKE_CXX_PLATFORM_ID "Cygwin") 15 | set(CMAKE_CXX_SIMULATE_ID "") 16 | set(CMAKE_CXX_SIMULATE_VERSION "") 17 | 18 | 19 | 20 | set(CMAKE_AR "C:/msys32/usr/bin/ar.exe") 21 | set(CMAKE_CXX_COMPILER_AR "C:/msys32/usr/bin/gcc-ar.exe") 22 | set(CMAKE_RANLIB "C:/msys32/usr/bin/ranlib.exe") 23 | set(CMAKE_CXX_COMPILER_RANLIB "C:/msys32/usr/bin/gcc-ranlib.exe") 24 | set(CMAKE_LINKER "C:/msys32/usr/bin/ld.exe") 25 | set(CMAKE_COMPILER_IS_GNUCXX 1) 26 | set(CMAKE_CXX_COMPILER_LOADED 1) 27 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 28 | set(CMAKE_CXX_ABI_COMPILED TRUE) 29 | set(CMAKE_COMPILER_IS_MINGW ) 30 | set(CMAKE_COMPILER_IS_CYGWIN 1) 31 | if(CMAKE_COMPILER_IS_CYGWIN) 32 | set(CYGWIN 1) 33 | set(UNIX 1) 34 | endif() 35 | 36 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 37 | 38 | if(CMAKE_COMPILER_IS_MINGW) 39 | set(MINGW 1) 40 | endif() 41 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 42 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 43 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) 44 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 45 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 46 | 47 | # Save compiler ABI information. 48 | set(CMAKE_CXX_SIZEOF_DATA_PTR "4") 49 | set(CMAKE_CXX_COMPILER_ABI "") 50 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 51 | 52 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 53 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 54 | endif() 55 | 56 | if(CMAKE_CXX_COMPILER_ABI) 57 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 58 | endif() 59 | 60 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 61 | set(CMAKE_LIBRARY_ARCHITECTURE "") 62 | endif() 63 | 64 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 65 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 66 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 67 | endif() 68 | 69 | 70 | 71 | 72 | 73 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;gcc_s;gcc;msys-2.0;advapi32;shell32;user32;kernel32;gcc_s;gcc") 74 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/i686-pc-msys/7.3.0;/usr/i686-pc-msys/lib;/usr/lib/w32api") 75 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 76 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/structmtmn__net__t.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: mtmn_net_t Struct Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 43 |
44 |
45 | 47 |
48 |
mtmn_net_t Struct Reference
49 |
50 |
51 | 52 |

#include <mtmn.h>

53 | 54 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |

55 | Data Fields

dl_matrix3d_t * category
 
dl_matrix3d_t * offset
 
dl_matrix3d_t * landmark
 
63 |

Field Documentation

64 | 65 |
66 |
67 | 68 | 69 | 70 | 71 |
dl_matrix3d_t* category
72 |
73 | 74 |
75 |
76 | 77 |
78 |
79 | 80 | 81 | 82 | 83 |
dl_matrix3d_t* landmark
84 |
85 | 86 |
87 |
88 | 89 |
90 |
91 | 92 | 93 | 94 | 95 |
dl_matrix3d_t* offset
96 |
97 | 98 |
99 |
100 |
The documentation for this struct was generated from the following file:
    101 |
  • /home/yehangyang/Documents/Gitlab/others/esp-face/face_detection/mtmn/include/mtmn.h
  • 102 |
103 |
104 | 105 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /components/esp32-camera/conversions/include/img_converters.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #ifndef _IMG_CONVERTERS_H_ 15 | #define _IMG_CONVERTERS_H_ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #include 22 | #include 23 | #include 24 | #include "esp_camera.h" 25 | 26 | typedef size_t (* jpg_out_cb)(void * arg, size_t index, const void* data, size_t len); 27 | 28 | /** 29 | * @brief Convert image buffer to JPEG 30 | * 31 | * @param src Source buffer in RGB565, RGB888, YUYV or GRAYSCALE format 32 | * @param src_len Length in bytes of the source buffer 33 | * @param width Width in pixels of the source image 34 | * @param height Height in pixels of the source image 35 | * @param format Format of the source image 36 | * @param quality JPEG quality of the resulting image 37 | * @param cp Callback to be called to write the bytes of the output JPEG 38 | * @param arg Pointer to be passed to the callback 39 | * 40 | * @return true on success 41 | */ 42 | bool fmt2jpg_cb(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, jpg_out_cb cb, void * arg); 43 | 44 | /** 45 | * @brief Convert camera frame buffer to JPEG 46 | * 47 | * @param fb Source camera frame buffer 48 | * @param quality JPEG quality of the resulting image 49 | * @param cp Callback to be called to write the bytes of the output JPEG 50 | * @param arg Pointer to be passed to the callback 51 | * 52 | * @return true on success 53 | */ 54 | bool frame2jpg_cb(camera_fb_t * fb, uint8_t quality, jpg_out_cb cb, void * arg); 55 | 56 | /** 57 | * @brief Convert image buffer to JPEG buffer 58 | * 59 | * @param src Source buffer in RGB565, RGB888, YUYV or GRAYSCALE format 60 | * @param src_len Length in bytes of the source buffer 61 | * @param width Width in pixels of the source image 62 | * @param height Height in pixels of the source image 63 | * @param format Format of the source image 64 | * @param quality JPEG quality of the resulting image 65 | * @param out Pointer to be populated with the address of the resulting buffer 66 | * @param out_len Pointer to be populated with the length of the output buffer 67 | * 68 | * @return true on success 69 | */ 70 | bool fmt2jpg(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, uint8_t ** out, size_t * out_len); 71 | 72 | /** 73 | * @brief Convert camera frame buffer to JPEG buffer 74 | * 75 | * @param fb Source camera frame buffer 76 | * @param quality JPEG quality of the resulting image 77 | * @param out Pointer to be populated with the address of the resulting buffer 78 | * @param out_len Pointer to be populated with the length of the output buffer 79 | * 80 | * @return true on success 81 | */ 82 | bool frame2jpg(camera_fb_t * fb, uint8_t quality, uint8_t ** out, size_t * out_len); 83 | 84 | /** 85 | * @brief Convert image buffer to BMP buffer 86 | * 87 | * @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format 88 | * @param src_len Length in bytes of the source buffer 89 | * @param width Width in pixels of the source image 90 | * @param height Height in pixels of the source image 91 | * @param format Format of the source image 92 | * @param out Pointer to be populated with the address of the resulting buffer 93 | * @param out_len Pointer to be populated with the length of the output buffer 94 | * 95 | * @return true on success 96 | */ 97 | bool fmt2bmp(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t ** out, size_t * out_len); 98 | 99 | /** 100 | * @brief Convert camera frame buffer to BMP buffer 101 | * 102 | * @param fb Source camera frame buffer 103 | * @param out Pointer to be populated with the address of the resulting buffer 104 | * @param out_len Pointer to be populated with the length of the output buffer 105 | * 106 | * @return true on success 107 | */ 108 | bool frame2bmp(camera_fb_t * fb, uint8_t ** out, size_t * out_len); 109 | 110 | /** 111 | * @brief Convert image buffer to RGB888 buffer (used for face detection) 112 | * 113 | * @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format 114 | * @param src_len Length in bytes of the source buffer 115 | * @param format Format of the source image 116 | * @param rgb_buf Pointer to the output buffer (width * height * 3) 117 | * 118 | * @return true on success 119 | */ 120 | bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf); 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | 126 | #endif /* _IMG_CONVERTERS_H_ */ 127 | -------------------------------------------------------------------------------- /components/fb_gfx/fb_gfx.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #include "stdint.h" 15 | #include "stdarg.h" 16 | #include "string.h" 17 | #include "stdio.h" 18 | #include "stdlib.h" 19 | #include "fb_gfx.h" 20 | 21 | typedef struct { // Data stored PER GLYPH 22 | uint16_t bitmapOffset; // Pointer into GFXfont->bitmap 23 | uint8_t width, height; // Bitmap dimensions in pixels 24 | uint8_t xAdvance; // Distance to advance cursor (x axis) 25 | int8_t xOffset, yOffset; // Dist from cursor pos to UL corner 26 | } GFXglyph; 27 | 28 | typedef struct { // Data stored for FONT AS A WHOLE: 29 | uint8_t *bitmap; // Glyph bitmaps, concatenated 30 | GFXglyph *glyph; // Glyph array 31 | uint8_t first, last; // ASCII extents 32 | uint8_t yAdvance; // Newline distance (y axis) 33 | uint8_t yOffset; // Y offset of the font zero line (y axis) 34 | } GFXfont; 35 | 36 | #include "FreeMonoBold12pt7b.h"//14x24 37 | #define gfxFont ((GFXfont*)(&FreeMonoBold12pt7b)) 38 | 39 | void fb_gfx_fillRect(fb_data_t *fb, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color) 40 | { 41 | int32_t line_step = (fb->width - w) * 3; 42 | uint8_t *data = fb->data + ((x + (y * fb->width)) * 3); 43 | uint8_t c0 = color >> 16; 44 | uint8_t c1 = color >> 8; 45 | uint8_t c2 = color; 46 | for (int i=0; ifirst) || (c > gfxFont->last)) { 75 | return xa; 76 | } 77 | 78 | c -= gfxFont->first; 79 | 80 | glyph = &(gfxFont->glyph[c]); 81 | bitmap = gfxFont->bitmap + glyph->bitmapOffset; 82 | 83 | xa = glyph->xAdvance; 84 | x += glyph->xOffset; 85 | y += glyph->yOffset; 86 | y += gfxFont->yOffset; 87 | line_width = 0; 88 | 89 | for(yy=0; yyheight; yy++) { 90 | for(xx=0; xxwidth; xx++) { 91 | if(bit == 0) { 92 | bits = *bitmap++; 93 | bit = 0x80; 94 | } 95 | if(bits & bit) { 96 | line_width++; 97 | } else if (line_width) { 98 | fb_gfx_drawFastHLine(fb, x+xx-line_width, y+yy, line_width, color); 99 | line_width=0; 100 | } 101 | bit >>= 1; 102 | } 103 | if (line_width) { 104 | fb_gfx_drawFastHLine(fb, x+xx-line_width, y+yy, line_width, color); 105 | line_width=0; 106 | } 107 | } 108 | return xa; 109 | } 110 | 111 | uint32_t fb_gfx_print(fb_data_t *fb, int x, int y, uint32_t color, const char * str) 112 | { 113 | uint32_t l = 0; 114 | int xc = x, yc = y, lc = fb->width - gfxFont->glyph[0].xAdvance; 115 | uint8_t fh = gfxFont->yAdvance; 116 | char c = *str++; 117 | while(c){ 118 | if(c != '\r'){ 119 | if(c == '\n'){ 120 | yc += fh; 121 | xc = x; 122 | } else { 123 | if(xc > lc){ 124 | yc += fh; 125 | xc = x; 126 | } 127 | xc += fb_gfx_putc(fb, xc, yc, color, c); 128 | } 129 | } 130 | l++; 131 | c = *str++; 132 | } 133 | return l; 134 | } 135 | 136 | uint32_t fb_gfx_printf(fb_data_t *fb, int32_t x, int32_t y, uint32_t color, const char *format, ...) 137 | { 138 | char loc_buf[64]; 139 | char * temp = loc_buf; 140 | int len; 141 | va_list arg; 142 | va_list copy; 143 | va_start(arg, format); 144 | va_copy(copy, arg); 145 | len = vsnprintf(loc_buf, sizeof(loc_buf), format, arg); 146 | va_end(copy); 147 | if(len >= sizeof(loc_buf)){ 148 | temp = (char*)malloc(len+1); 149 | if(temp == NULL) { 150 | return 0; 151 | } 152 | } 153 | vsnprintf(temp, len+1, format, arg); 154 | va_end(arg); 155 | fb_gfx_print(fb, x, y, color, temp); 156 | if(len > 64){ 157 | free(temp); 158 | } 159 | return len; 160 | } 161 | -------------------------------------------------------------------------------- /components/recorder_engine/include/esp_sr_iface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdint.h" 3 | #include "esp_err.h" 4 | 5 | //Opaque model data container 6 | typedef struct model_iface_data_t model_iface_data_t; 7 | 8 | //Set wake words recognition operating mode 9 | //The probability of being wake words is increased with increasing mode, 10 | //As a consequence also the false alarm rate goes up 11 | typedef enum { 12 | DET_MODE_90 = 0, //Normal, response accuracy rate about 90% 13 | DET_MODE_95 //Aggressive, response accuracy rate about 95% 14 | } det_mode_t; 15 | 16 | typedef struct { 17 | int wake_word_num; //The number of all wake words 18 | char **wake_word_list; //The name list of wake words 19 | } wake_word_info_t; 20 | 21 | /** 22 | * @brief Easy function type to initialze a model instance with a detection mode 23 | * 24 | * @param det_mode The wake words detection mode to trigger wake words, the range of det_threshold is 0.5~0.9999 25 | * @returns Handle to the model data 26 | */ 27 | typedef model_iface_data_t* (*esp_sr_iface_op_create_t)(det_mode_t det_mode); 28 | 29 | 30 | /** 31 | * @brief Callback function type to fetch the amount of samples that need to be passed to the detect function 32 | * 33 | * Every speech recognition model processes a certain number of samples at the same time. This function 34 | * can be used to query that amount. Note that the returned amount is in 16-bit samples, not in bytes. 35 | * 36 | * @param model The model object to query 37 | * @return The amount of samples to feed the detect function 38 | */ 39 | typedef int (*esp_sr_iface_op_get_samp_chunksize_t)(model_iface_data_t *model); 40 | 41 | 42 | /** 43 | * @brief Get the sample rate of the samples to feed to the detect function 44 | * 45 | * @param model The model object to query 46 | * @return The sample rate, in hz 47 | */ 48 | typedef int (*esp_sr_iface_op_get_samp_rate_t)(model_iface_data_t *model); 49 | 50 | /** 51 | * @brief Get the number of wake words 52 | * 53 | * @param model The model object to query 54 | * @returns the number of wake words 55 | */ 56 | typedef int (*esp_sr_iface_op_get_word_num_t)(model_iface_data_t *model); 57 | 58 | /** 59 | * @brief Get the name of wake word by index 60 | * 61 | * @Warning The index of wake word start with 1 62 | 63 | * @param model The model object to query 64 | * @param word_index The index of wake word 65 | * @returns the detection threshold 66 | */ 67 | typedef char* (*esp_sr_iface_op_get_word_name_t)(model_iface_data_t *model, int word_index); 68 | 69 | /** 70 | * @brief Get the structure which contains the information about wake words 71 | * 72 | * @param model The model object to query 73 | * @param word_list The structure which contains the number and name of wake words 74 | * @return 75 | * - ESP_OK Success 76 | * - ESP_FAIL The word_list is NULL. 77 | */ 78 | typedef esp_err_t (*esp_sr_iface_op_get_word_list_t)(model_iface_data_t *model, wake_word_info_t* word_list); 79 | 80 | /** 81 | * @brief Set the detection threshold to manually abjust the probability 82 | * 83 | * @param model The model object to query 84 | * @param det_treshold The threshold to trigger wake words, the range of det_threshold is 0.5~0.9999 85 | * @param word_index The index of wake word 86 | * @return 0: setting failed, 1: setting success 87 | */ 88 | typedef int (*esp_sr_iface_op_set_det_threshold_t)(model_iface_data_t *model, float det_threshold, int word_index); 89 | 90 | /** 91 | * @brief Get the wake word detection threshold of different modes 92 | * 93 | * @param model The model object to query 94 | * @param det_mode The wake words recognition operating mode 95 | * @param word_index The index of wake word 96 | * @returns the detection threshold 97 | */ 98 | typedef float (*esp_sr_iface_op_get_det_threshold_t)(model_iface_data_t *model, det_mode_t det_mode, int word_index); 99 | 100 | /** 101 | * @brief Feed samples of an audio stream to the speech recognition model and detect if there is a keyword found. 102 | * 103 | * @Warning The index of wake word start with 1, 0 means no wake words is detected. 104 | * 105 | * @param model The model object to query 106 | * @param samples An array of 16-bit signed audio samples. The array size used can be queried by the 107 | * get_samp_chunksize function. 108 | * @return The index of wake words, return 0 if no wake word is detected, else the index of the wake words. 109 | */ 110 | typedef int (*esp_sr_iface_op_detect_t)(model_iface_data_t *model, int16_t *samples); 111 | 112 | /** 113 | * @brief Destroy a speech recognition model 114 | * 115 | * @param model Model object to destroy 116 | */ 117 | typedef void (*esp_sr_iface_op_destroy_t)(model_iface_data_t *model); 118 | 119 | 120 | /** 121 | * This structure contains the functions used to do operations on a speech recognition model. 122 | */ 123 | typedef struct { 124 | esp_sr_iface_op_create_t create; 125 | esp_sr_iface_op_get_samp_chunksize_t get_samp_chunksize; 126 | esp_sr_iface_op_get_samp_rate_t get_samp_rate; 127 | esp_sr_iface_op_get_word_num_t get_word_num; 128 | esp_sr_iface_op_get_word_name_t get_word_name; 129 | esp_sr_iface_op_get_word_list_t get_word_list; 130 | esp_sr_iface_op_set_det_threshold_t set_det_threshold; 131 | esp_sr_iface_op_get_det_threshold_t get_det_threshold_by_mode; 132 | esp_sr_iface_op_detect_t detect; 133 | esp_sr_iface_op_destroy_t destroy; 134 | } esp_sr_iface_t; -------------------------------------------------------------------------------- /components/esp-face/lib/include/dl_lib_matrix3dq.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "dl_lib_matrix3d.h" 3 | 4 | typedef int16_t qtp_t; 5 | 6 | /* 7 | * Matrix for 3d 8 | * @Warning: the sequence of variables is fixed, cannot be modified, otherwise there will be errors in esp_dsp_dot_float 9 | */ 10 | typedef struct 11 | { 12 | /******* fix start *******/ 13 | int w; // Width 14 | int h; // Height 15 | int c; // Channel 16 | int n; // Number, to record filter's out_channels. input and output must be 1 17 | int stride; 18 | int exponent; 19 | qtp_t *item; 20 | /******* fix end *******/ 21 | } dl_matrix3dq_t; 22 | 23 | #define DL_QTP_SHIFT 15 24 | #define DL_QTP_RANGE ((1<itemq[(y)+(x)*m->stride] 26 | #define DL_QTP_EXP_NA 255 //non-applicable exponent because matrix is null 27 | 28 | #define DL_SHIFT_AUTO 32 29 | 30 | /* 31 | * @brief Allocate a 3D matrix 32 | * 33 | * @param n,w,h,c number, width, height, channel 34 | * @return 3d matrix 35 | */ 36 | dl_matrix3dq_t *dl_matrix3dq_alloc(int n, int w, int h, int c, int e); 37 | 38 | /* 39 | * @brief Free a 3D matrix 40 | * 41 | * @param m matrix 42 | */ 43 | void dl_matrix3dq_free(dl_matrix3dq_t *m); 44 | 45 | /** 46 | * @brief Zero out the matrix 47 | * Sets all entries in the matrix to 0. 48 | * 49 | * @param m Matrix to zero 50 | */ 51 | 52 | dl_matrix3d_t *dl_matrix3d_from_matrixq(dl_matrix3dq_t *m); 53 | dl_matrix3dq_t *dl_matrixq_from_matrix3d_qmf(dl_matrix3d_t *m,int exponent); 54 | dl_matrix3dq_t *dl_matrixq_from_matrix3d(dl_matrix3d_t *m); 55 | /** 56 | * @brief Copy a range of items from an existing matrix to a preallocated matrix 57 | * 58 | * @param in Old matrix (with foreign data) to re-use. Passing NULL will allocate a new matrix. 59 | * @param x X-offset of the origin of the returned matrix within the sliced matrix 60 | * @param y Y-offset of the origin of the returned matrix within the sliced matrix 61 | * @param w Width of the resulting matrix 62 | * @param h Height of the resulting matrix 63 | * @return The resulting slice matrix 64 | */ 65 | void dl_matrix3dq_slice_copy (dl_matrix3dq_t *dst, dl_matrix3dq_t *src, int x, int y, int w, int h); 66 | 67 | 68 | /** 69 | * @brief Do a general CNN layer pass, dimension is (number, width, height, channel) 70 | * 71 | * @param in Input image 72 | * @param filter Weights of the neurons 73 | * @param bias Bias for the CNN layer. 74 | * @param stride_x The step length of the convolution window in x(width) direction 75 | * @param stride_y The step length of the convolution window in y(height) direction 76 | * @param padding One of VALID or SAME 77 | * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect. 78 | * If ESP_PLATFORM is not defined, this value is not used. 79 | * @return The result of CNN layer. 80 | */ 81 | dl_matrix3dq_t *dl_matrix3dq_fc (dl_matrix3dq_t *in, dl_matrix3dq_t *filter, dl_matrix3dq_t *bias, int exponent,int mode); 82 | 83 | dl_matrix3dq_t *dl_matrix3dq_conv (dl_matrix3dq_t *in, dl_matrix3dq_t *filter, dl_matrix3dq_t *bias, 84 | int stride_x, int stride_y, int padding, int exponent, int mode); 85 | dl_matrix3dq_t *dl_matrix3dq_conv_normal (dl_matrix3dq_t *in, dl_matrix3dq_t *filter, dl_matrix3dq_t *bias, 86 | int stride_x, int stride_y, int padding, int exponent, int mode); 87 | 88 | /** 89 | * @brief Print the matrix3d items 90 | * 91 | * @param m dl_matrix3d_t to be printed 92 | * @param message name of matrix 93 | */ 94 | void dl_matrix3dq_print (dl_matrix3dq_t *m, char *message); 95 | 96 | dl_matrix3dq_t *dl_matrix3dq_depthwise_conv (dl_matrix3dq_t *in, dl_matrix3dq_t *filter, 97 | int stride_x, int stride_y, int padding, int exponent, int mode); 98 | 99 | void dl_matrix3dq_relu (dl_matrix3dq_t *m, fptp_t clip); 100 | 101 | 102 | 103 | dl_matrix3dq_t *dl_matrix3dq_global_pool (dl_matrix3dq_t *in); 104 | void dl_matrix3dq_batch_normalize (dl_matrix3dq_t *m, dl_matrix3dq_t *scale, dl_matrix3dq_t *offset); 105 | dl_matrix3dq_t *dl_matrix3dq_add (dl_matrix3dq_t *in_1, dl_matrix3dq_t *in_2, int exponent); 106 | void dl_matrix3dq_relu_std (dl_matrix3dq_t *m); 107 | dl_matrix3dq_t *dl_matrix3dq_mobilefaceblock (void *in, dl_matrix3dq_t *pw, dl_matrix3dq_t *pw_bn_scale,dl_matrix3dq_t *pw_bn_offset, 108 | dl_matrix3dq_t *dw, dl_matrix3dq_t *dw_bn_scale,dl_matrix3dq_t *dw_bn_offset, 109 | dl_matrix3dq_t *pw_linear, dl_matrix3dq_t *pw_linear_bn_scale,dl_matrix3dq_t *pw_linear_bn_offset, 110 | int pw_exponent,int dw_exponent,int pw_linear_exponent,int stride_x, int stride_y, int padding, int mode, int shortcut); 111 | 112 | dl_matrix3dq_t *dl_matrix3dq_concat(dl_matrix3dq_t *in_1, dl_matrix3dq_t *in_2); 113 | dl_matrix3dq_t *dl_matrix3dq_concat_4(dl_matrix3dq_t *in_1, dl_matrix3dq_t *in_2, dl_matrix3dq_t *in_3, dl_matrix3dq_t *in_4); 114 | dl_matrix3dq_t *dl_matrix3dq_concat_8(dl_matrix3dq_t *in_1, dl_matrix3dq_t *in_2, dl_matrix3dq_t *in_3, dl_matrix3dq_t *in_4, dl_matrix3dq_t *in_5, dl_matrix3dq_t *in_6, dl_matrix3dq_t *in_7, dl_matrix3dq_t *in_8); 115 | 116 | dl_matrix3dq_t *dl_matrix3dq_mobilefaceblock_split (void *in, dl_matrix3dq_t *pw_1, dl_matrix3dq_t *pw_2, dl_matrix3dq_t *pw_bn_scale,dl_matrix3dq_t *pw_bn_offset, 117 | dl_matrix3dq_t *dw, dl_matrix3dq_t *dw_bn_scale,dl_matrix3dq_t *dw_bn_offset, 118 | dl_matrix3dq_t *pw_linear_1, dl_matrix3dq_t *pw_linear_2, dl_matrix3dq_t *pw_linear_bn_scale,dl_matrix3dq_t *pw_linear_bn_offset, 119 | int pw_exponent,int dw_exponent,int pw_linear_exponent,int stride_x, int stride_y, int padding, int mode, int shortcut); 120 | -------------------------------------------------------------------------------- /components/esp32-camera/conversions/private_include/jpge.h: -------------------------------------------------------------------------------- 1 | // jpge.h - C++ class for JPEG compression. 2 | // Public domain, Rich Geldreich 3 | // Alex Evans: Added RGBA support, linear memory allocator. 4 | #ifndef JPEG_ENCODER_H 5 | #define JPEG_ENCODER_H 6 | 7 | namespace jpge 8 | { 9 | typedef unsigned char uint8; 10 | typedef signed short int16; 11 | typedef signed int int32; 12 | typedef unsigned short uint16; 13 | typedef unsigned int uint32; 14 | typedef unsigned int uint; 15 | 16 | // JPEG chroma subsampling factors. Y_ONLY (grayscale images) and H2V2 (color images) are the most common. 17 | enum subsampling_t { Y_ONLY = 0, H1V1 = 1, H2V1 = 2, H2V2 = 3 }; 18 | 19 | // JPEG compression parameters structure. 20 | struct params { 21 | inline params() : m_quality(85), m_subsampling(H2V2) { } 22 | 23 | inline bool check() const { 24 | if ((m_quality < 1) || (m_quality > 100)) { 25 | return false; 26 | } 27 | if ((uint)m_subsampling > (uint)H2V2) { 28 | return false; 29 | } 30 | return true; 31 | } 32 | 33 | // Quality: 1-100, higher is better. Typical values are around 50-95. 34 | int m_quality; 35 | 36 | // m_subsampling: 37 | // 0 = Y (grayscale) only 38 | // 1 = H1V1 subsampling (YCbCr 1x1x1, 3 blocks per MCU) 39 | // 2 = H2V1 subsampling (YCbCr 2x1x1, 4 blocks per MCU) 40 | // 3 = H2V2 subsampling (YCbCr 4x1x1, 6 blocks per MCU-- very common) 41 | subsampling_t m_subsampling; 42 | }; 43 | 44 | // Output stream abstract class - used by the jpeg_encoder class to write to the output stream. 45 | // put_buf() is generally called with len==JPGE_OUT_BUF_SIZE bytes, but for headers it'll be called with smaller amounts. 46 | class output_stream { 47 | public: 48 | virtual ~output_stream() { }; 49 | virtual bool put_buf(const void* Pbuf, int len) = 0; 50 | virtual uint get_size() const = 0; 51 | }; 52 | 53 | // Lower level jpeg_encoder class - useful if more control is needed than the above helper functions. 54 | class jpeg_encoder { 55 | public: 56 | jpeg_encoder(); 57 | ~jpeg_encoder(); 58 | 59 | // Initializes the compressor. 60 | // pStream: The stream object to use for writing compressed data. 61 | // params - Compression parameters structure, defined above. 62 | // width, height - Image dimensions. 63 | // channels - May be 1, or 3. 1 indicates grayscale, 3 indicates RGB source data. 64 | // Returns false on out of memory or if a stream write fails. 65 | bool init(output_stream *pStream, int width, int height, int src_channels, const params &comp_params = params()); 66 | 67 | // Call this method with each source scanline. 68 | // width * src_channels bytes per scanline is expected (RGB or Y format). 69 | // You must call with NULL after all scanlines are processed to finish compression. 70 | // Returns false on out of memory or if a stream write fails. 71 | bool process_scanline(const void* pScanline); 72 | 73 | // Deinitializes the compressor, freeing any allocated memory. May be called at any time. 74 | void deinit(); 75 | 76 | private: 77 | jpeg_encoder(const jpeg_encoder &); 78 | jpeg_encoder &operator =(const jpeg_encoder &); 79 | 80 | typedef int32 sample_array_t; 81 | enum { JPGE_OUT_BUF_SIZE = 512 }; 82 | 83 | output_stream *m_pStream; 84 | params m_params; 85 | uint8 m_num_components; 86 | uint8 m_comp_h_samp[3], m_comp_v_samp[3]; 87 | int m_image_x, m_image_y, m_image_bpp, m_image_bpl; 88 | int m_image_x_mcu, m_image_y_mcu; 89 | int m_image_bpl_xlt, m_image_bpl_mcu; 90 | int m_mcus_per_row; 91 | int m_mcu_x, m_mcu_y; 92 | uint8 *m_mcu_lines[16]; 93 | uint8 m_mcu_y_ofs; 94 | sample_array_t m_sample_array[64]; 95 | int16 m_coefficient_array[64]; 96 | 97 | int m_last_dc_val[3]; 98 | uint8 m_out_buf[JPGE_OUT_BUF_SIZE]; 99 | uint8 *m_pOut_buf; 100 | uint m_out_buf_left; 101 | uint32 m_bit_buffer; 102 | uint m_bits_in; 103 | uint8 m_pass_num; 104 | bool m_all_stream_writes_succeeded; 105 | 106 | bool jpg_open(int p_x_res, int p_y_res, int src_channels); 107 | 108 | void flush_output_buffer(); 109 | void put_bits(uint bits, uint len); 110 | 111 | void emit_byte(uint8 i); 112 | void emit_word(uint i); 113 | void emit_marker(int marker); 114 | 115 | void emit_jfif_app0(); 116 | void emit_dqt(); 117 | void emit_sof(); 118 | void emit_dht(uint8 *bits, uint8 *val, int index, bool ac_flag); 119 | void emit_dhts(); 120 | void emit_sos(); 121 | 122 | void compute_quant_table(int32 *dst, const int16 *src); 123 | void load_quantized_coefficients(int component_num); 124 | 125 | void load_block_8_8_grey(int x); 126 | void load_block_8_8(int x, int y, int c); 127 | void load_block_16_8(int x, int c); 128 | void load_block_16_8_8(int x, int c); 129 | 130 | void code_coefficients_pass_two(int component_num); 131 | void code_block(int component_num); 132 | 133 | void process_mcu_row(); 134 | bool process_end_of_image(); 135 | void load_mcu(const void* src); 136 | void clear(); 137 | void init(); 138 | }; 139 | 140 | } // namespace jpge 141 | 142 | #endif // JPEG_ENCODER 143 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/face__detection__forward_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | mtmn: /home/yehangyang/Documents/Gitlab/others/esp-face/face_detection/mtmn/include/face_detection_forward.h File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
mtmn 21 |
22 |
26 |
27 | 28 | 29 | 36 | 42 | 46 |
47 |
48 |
49 | Macros | 50 | Functions
51 |
52 |
face_detection_forward.h File Reference
53 |
54 |
55 |
#include "image_util.h"
56 | #include "dl_lib.h"
57 |
58 | Include dependency graph for face_detection_forward.h:
59 |
60 |
61 |
62 |
63 |

Go to the source code of this file.

64 | 65 | 67 | 68 | 69 |

66 | Macros

#define MAX_DETECTION   1
 
70 | 72 | 73 | 74 | 75 |

71 | Functions

box_array_t * face_detect (dl_matrix3du_t *image_matrix)
 Do MTMN face detection, return box and landmark infomation. More...
 
76 |

Macro Definition Documentation

77 | 78 |
79 |
80 | 81 | 82 | 83 | 84 |
#define MAX_DETECTION   1
85 |
86 | 87 |
88 |
89 |

Function Documentation

90 | 91 |
92 |
93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |
box_array_t* face_detect (dl_matrix3du_t * image_matrix)
102 |
103 | 104 |

Do MTMN face detection, return box and landmark infomation.

105 |
Parameters
106 | 107 | 108 |
image_matrixImage matrix, rgb888 format
109 |
110 |
111 |
Returns
box_array_t* A list of boxes and score.
112 | 113 |
114 |
115 |
116 | 117 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /components/esp-face/docs/en/api-reference/mtmn/html/index.hhk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
    7 |
  • 8 |
  • 9 |
  • 10 |
      11 |
    • 12 |
    • 13 |
    14 |
  • 15 |
  • 16 |
  • 17 |
  • 18 |
  • 19 |
      20 |
    • 21 |
    • 22 |
    • 23 |
    • 24 |
    • 25 |
    • 26 |
    27 |
  • 28 |
      29 |
    • 30 |
    • 31 |
    • 32 |
    33 |
  • 34 |
      35 |
    • 36 |
    • 37 |
    • 38 |
    • 39 |
    • 40 |
    • 41 |
    42 |
  • 43 |
  • 44 |
  • 45 |
  • 46 |
  • 47 |
  • 48 |
  • 49 |
  • 50 |
  • 51 |
  • 52 |
  • 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /main/app_wifi.c: -------------------------------------------------------------------------------- 1 | /* ESPRESSIF MIT License 2 | * 3 | * Copyright (c) 2018 4 | * 5 | * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case, 6 | * it is free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished 10 | * to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all copies or 13 | * substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | #include 23 | #include "freertos/FreeRTOS.h" 24 | #include "freertos/task.h" 25 | #include "freertos/event_groups.h" 26 | #include "esp_system.h" 27 | #include "esp_wifi.h" 28 | #include "esp_event_loop.h" 29 | #include "esp_log.h" 30 | #include "nvs_flash.h" 31 | #include "sdkconfig.h" 32 | 33 | #include "lwip/err.h" 34 | #include "lwip/sys.h" 35 | 36 | /* The examples use WiFi configuration that you can set via 'make menuconfig'. 37 | 38 | If you'd rather not, just change the below entries to strings with 39 | the config you want - ie #define EXAMPLE_WIFI_SSID "mywifissid" 40 | */ 41 | #define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID 42 | #define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD 43 | #define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY 44 | #define EXAMPLE_ESP_WIFI_AP_SSID CONFIG_ESP_WIFI_AP_SSID 45 | #define EXAMPLE_ESP_WIFI_AP_PASS CONFIG_ESP_WIFI_AP_PASSWORD 46 | #define EXAMPLE_IP_ADDR CONFIG_SERVER_IP 47 | 48 | static const char *TAG = "camera wifi"; 49 | 50 | static int s_retry_num = 0; 51 | 52 | static esp_err_t event_handler(void *ctx, system_event_t *event) 53 | { 54 | switch(event->event_id) { 55 | case SYSTEM_EVENT_AP_STACONNECTED: 56 | ESP_LOGI(TAG, "station:" MACSTR " join, AID=%d", 57 | MAC2STR(event->event_info.sta_connected.mac), 58 | event->event_info.sta_connected.aid); 59 | break; 60 | case SYSTEM_EVENT_AP_STADISCONNECTED: 61 | ESP_LOGI(TAG, "station:" MACSTR "leave, AID=%d", 62 | MAC2STR(event->event_info.sta_disconnected.mac), 63 | event->event_info.sta_disconnected.aid); 64 | break; 65 | case SYSTEM_EVENT_STA_START: 66 | esp_wifi_connect(); 67 | break; 68 | case SYSTEM_EVENT_STA_GOT_IP: 69 | ESP_LOGI(TAG, "got ip:%s", 70 | ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip)); 71 | s_retry_num = 0; 72 | break; 73 | case SYSTEM_EVENT_STA_DISCONNECTED: 74 | { 75 | if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY) { 76 | esp_wifi_connect(); 77 | s_retry_num++; 78 | ESP_LOGI(TAG,"retry to connect to the AP"); 79 | } 80 | ESP_LOGI(TAG,"connect to the AP fail"); 81 | break; 82 | } 83 | default: 84 | break; 85 | } 86 | return ESP_OK; 87 | } 88 | 89 | void wifi_init_softap() 90 | { 91 | if (strcmp(EXAMPLE_IP_ADDR, "192.168.4.1")) 92 | { 93 | int a, b, c, d; 94 | sscanf(EXAMPLE_IP_ADDR, "%d.%d.%d.%d", &a, &b, &c, &d); 95 | tcpip_adapter_ip_info_t ip_info; 96 | IP4_ADDR(&ip_info.ip, a, b, c, d); 97 | IP4_ADDR(&ip_info.gw, a, b, c, d); 98 | IP4_ADDR(&ip_info.netmask, 255, 255, 255, 0); 99 | ESP_ERROR_CHECK(tcpip_adapter_dhcps_stop(WIFI_IF_AP)); 100 | ESP_ERROR_CHECK(tcpip_adapter_set_ip_info(WIFI_IF_AP, &ip_info)); 101 | ESP_ERROR_CHECK(tcpip_adapter_dhcps_start(WIFI_IF_AP)); 102 | } 103 | wifi_config_t wifi_config; 104 | memset(&wifi_config, 0, sizeof(wifi_config_t)); 105 | snprintf((char*)wifi_config.ap.ssid, 32, "%s", EXAMPLE_ESP_WIFI_AP_SSID); 106 | wifi_config.ap.ssid_len = strlen((char*)wifi_config.ap.ssid); 107 | snprintf((char*)wifi_config.ap.password, 64, "%s", EXAMPLE_ESP_WIFI_AP_PASS); 108 | wifi_config.ap.max_connection = 3; 109 | wifi_config.ap.authmode = WIFI_AUTH_WPA_WPA2_PSK; 110 | if (strlen(EXAMPLE_ESP_WIFI_AP_PASS) == 0) { 111 | wifi_config.ap.authmode = WIFI_AUTH_OPEN; 112 | } 113 | 114 | ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config)); 115 | 116 | ESP_LOGI(TAG, "wifi_init_softap finished.SSID:%s password:%s", 117 | EXAMPLE_ESP_WIFI_AP_SSID, EXAMPLE_ESP_WIFI_AP_PASS); 118 | } 119 | 120 | void wifi_init_sta() 121 | { 122 | wifi_config_t wifi_config; 123 | memset(&wifi_config, 0, sizeof(wifi_config_t)); 124 | snprintf((char*)wifi_config.sta.ssid, 32, "%s", EXAMPLE_ESP_WIFI_SSID); 125 | snprintf((char*)wifi_config.sta.password, 64, "%s", EXAMPLE_ESP_WIFI_PASS); 126 | 127 | ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); 128 | 129 | ESP_LOGI(TAG, "wifi_init_sta finished."); 130 | ESP_LOGI(TAG, "connect to ap SSID:%s password:%s", 131 | EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS); 132 | } 133 | 134 | void app_wifi_main() 135 | { 136 | wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); 137 | wifi_mode_t mode = WIFI_MODE_NULL; 138 | 139 | if (strlen(EXAMPLE_ESP_WIFI_AP_SSID) && strlen(EXAMPLE_ESP_WIFI_SSID)) { 140 | mode = WIFI_MODE_APSTA; 141 | } else if (strlen(EXAMPLE_ESP_WIFI_AP_SSID)) { 142 | mode = WIFI_MODE_AP; 143 | } else if (strlen(EXAMPLE_ESP_WIFI_SSID)) { 144 | mode = WIFI_MODE_STA; 145 | } 146 | 147 | esp_err_t ret = nvs_flash_init(); 148 | if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { 149 | ESP_ERROR_CHECK(nvs_flash_erase()); 150 | ret = nvs_flash_init(); 151 | } 152 | ESP_ERROR_CHECK(ret); 153 | 154 | if (mode == WIFI_MODE_NULL) { 155 | ESP_LOGW(TAG,"Neither AP or STA have been configured. WiFi will be off."); 156 | return; 157 | } 158 | 159 | tcpip_adapter_init(); 160 | ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL)); 161 | ESP_ERROR_CHECK(esp_wifi_init(&cfg)); 162 | ESP_ERROR_CHECK(esp_wifi_set_mode(mode)); 163 | 164 | if (mode & WIFI_MODE_AP) { 165 | wifi_init_softap(); 166 | } 167 | 168 | if (mode & WIFI_MODE_STA) { 169 | wifi_init_sta(); 170 | } 171 | ESP_ERROR_CHECK(esp_wifi_start()); 172 | } 173 | --------------------------------------------------------------------------------