diff --git a/components/modules/ai/who_cat_face_detection.hpp b/components/modules/ai/who_cat_face_detection.hpp index 0fcded6..290ba86 100644 --- a/components/modules/ai/who_cat_face_detection.hpp +++ b/components/modules/ai/who_cat_face_detection.hpp @@ -9,4 +9,4 @@ void register_cat_face_detection(QueueHandle_t frame_i, QueueHandle_t event, QueueHandle_t result, QueueHandle_t frame_o, - const bool camera_fb_return); + const bool camera_fb_return = false); diff --git a/examples/cat_face_detection/README.rst b/examples/cat_face_detection/README.rst new file mode 100755 index 0000000..14c6d99 --- /dev/null +++ b/examples/cat_face_detection/README.rst @@ -0,0 +1,15 @@ +################################################################################################################################ +Motion Detection +################################################################################################################################ + ++---------------------+---------+-----------------+------------+ +| SoC | ESP32 | ESP32-S2 | ESP32-S3 | ++---------------------+---------+-----------------+------------+ +| kit | ESP-EYE | ESP32-S2-Kaluga | ESP-S3-EYE | ++----------+----------+---------+-----------------+------------+ +| | terminal | Y | Y | Y | +| +----------+---------+-----------------+------------+ +| examples | web | Y | — | Y | +| +----------+---------+-----------------+------------+ +| | lcd | — | — | Y | ++----------+----------+---------+-----------------+------------+ diff --git a/examples/cat_face_detection/web/CMakeLists.txt b/examples/cat_face_detection/web/CMakeLists.txt new file mode 100644 index 0000000..95d4faa --- /dev/null +++ b/examples/cat_face_detection/web/CMakeLists.txt @@ -0,0 +1,8 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +set(EXTRA_COMPONENT_DIRS ../../../components) +add_compile_options(-fdiagnostics-color=always) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(cat_face_detection_web) diff --git a/examples/cat_face_detection/web/main/CMakeLists.txt b/examples/cat_face_detection/web/main/CMakeLists.txt new file mode 100644 index 0000000..5eea762 --- /dev/null +++ b/examples/cat_face_detection/web/main/CMakeLists.txt @@ -0,0 +1 @@ +idf_component_register(SRCS "app_main.cpp") diff --git a/examples/cat_face_detection/web/main/app_main.cpp b/examples/cat_face_detection/web/main/app_main.cpp new file mode 100755 index 0000000..41c3a28 --- /dev/null +++ b/examples/cat_face_detection/web/main/app_main.cpp @@ -0,0 +1,21 @@ +#include "who_camera.h" +#include "who_cat_face_detection.hpp" +#include "app_wifi.h" +#include "app_httpd.hpp" +#include "app_mdns.h" + +static QueueHandle_t xQueueAIFrame = NULL; +static QueueHandle_t xQueueHttpFrame = NULL; + +extern "C" void app_main() +{ + app_wifi_main(); + app_mdns_main(); + + xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *)); + xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *)); + + register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame); + register_cat_face_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame); + register_httpd(xQueueHttpFrame, NULL, true); +} diff --git a/examples/cat_face_detection/web/partitions.csv b/examples/cat_face_detection/web/partitions.csv new file mode 100644 index 0000000..d6fdf11 --- /dev/null +++ b/examples/cat_face_detection/web/partitions.csv @@ -0,0 +1,5 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild +factory, app, factory, 0x010000, 3840K +nvs, data, nvs, 0x3D0000, 16K +fr, 32, 32, 0x3E0000, 128K diff --git a/examples/cat_face_detection/web/sdkconfig.defaults b/examples/cat_face_detection/web/sdkconfig.defaults new file mode 100644 index 0000000..185bc0c --- /dev/null +++ b/examples/cat_face_detection/web/sdkconfig.defaults @@ -0,0 +1,18 @@ +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y + +CONFIG_SPIRAM_SPEED_80M=y + +CONFIG_ESP_WIFI_AP_SSID="Cat Face Detection" + +CONFIG_ESP_TASK_WDT=n + +# Wait for esp-idf stable +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +CONFIG_SPIRAM_MEMTEST=n + +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" diff --git a/examples/cat_face_detection/web/sdkconfig.defaults.esp32 b/examples/cat_face_detection/web/sdkconfig.defaults.esp32 new file mode 100644 index 0000000..ecc2d87 --- /dev/null +++ b/examples/cat_face_detection/web/sdkconfig.defaults.esp32 @@ -0,0 +1,4 @@ +CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32_SPIRAM_SUPPORT=y + +CONFIG_CAMERA_MODULE_ESP_EYE=y \ No newline at end of file diff --git a/examples/cat_face_detection/web/sdkconfig.defaults.esp32s2 b/examples/cat_face_detection/web/sdkconfig.defaults.esp32s2 new file mode 100644 index 0000000..3b5e99c --- /dev/null +++ b/examples/cat_face_detection/web/sdkconfig.defaults.esp32s2 @@ -0,0 +1,7 @@ +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +CONFIG_ESP32S2_DATA_CACHE_16KB=y +ESP32S2_DATA_CACHE_LINE_32B=y + +CONFIG_CAMERA_MODULE_ESP_S2_KALUGA=y \ No newline at end of file diff --git a/examples/cat_face_detection/web/sdkconfig.defaults.esp32s3 b/examples/cat_face_detection/web/sdkconfig.defaults.esp32s3 new file mode 100644 index 0000000..d8033e2 --- /dev/null +++ b/examples/cat_face_detection/web/sdkconfig.defaults.esp32s3 @@ -0,0 +1,11 @@ +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_SPIRAM_SUPPORT=y + +CONFIG_ESP32S3_DATA_CACHE_64KB=y +CONFIG_ESP32S3_DATA_CACHE_8WAYS=y +CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y + +CONFIG_CAMERA_MODULE_ESP_S3_EYE=y +CONFIG_ESPTOOLPY_NO_STUB=y +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y +CONFIG_SPIRAM_MODE_OCT=y diff --git a/examples/human_face_detection/README.rst b/examples/human_face_detection/README.rst new file mode 100755 index 0000000..14c6d99 --- /dev/null +++ b/examples/human_face_detection/README.rst @@ -0,0 +1,15 @@ +################################################################################################################################ +Motion Detection +################################################################################################################################ + ++---------------------+---------+-----------------+------------+ +| SoC | ESP32 | ESP32-S2 | ESP32-S3 | ++---------------------+---------+-----------------+------------+ +| kit | ESP-EYE | ESP32-S2-Kaluga | ESP-S3-EYE | ++----------+----------+---------+-----------------+------------+ +| | terminal | Y | Y | Y | +| +----------+---------+-----------------+------------+ +| examples | web | Y | — | Y | +| +----------+---------+-----------------+------------+ +| | lcd | — | — | Y | ++----------+----------+---------+-----------------+------------+ diff --git a/examples/human_face_detection/web/CMakeLists.txt b/examples/human_face_detection/web/CMakeLists.txt new file mode 100644 index 0000000..c274f56 --- /dev/null +++ b/examples/human_face_detection/web/CMakeLists.txt @@ -0,0 +1,8 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +set(EXTRA_COMPONENT_DIRS ../../../components) +add_compile_options(-fdiagnostics-color=always) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(human_face_detection_web) diff --git a/examples/human_face_detection/web/main/CMakeLists.txt b/examples/human_face_detection/web/main/CMakeLists.txt new file mode 100644 index 0000000..5eea762 --- /dev/null +++ b/examples/human_face_detection/web/main/CMakeLists.txt @@ -0,0 +1 @@ +idf_component_register(SRCS "app_main.cpp") diff --git a/examples/human_face_detection/web/main/app_main.cpp b/examples/human_face_detection/web/main/app_main.cpp new file mode 100755 index 0000000..e208a83 --- /dev/null +++ b/examples/human_face_detection/web/main/app_main.cpp @@ -0,0 +1,21 @@ +#include "who_camera.h" +#include "who_human_face_detection.hpp" +#include "app_wifi.h" +#include "app_httpd.hpp" +#include "app_mdns.h" + +static QueueHandle_t xQueueAIFrame = NULL; +static QueueHandle_t xQueueHttpFrame = NULL; + +extern "C" void app_main() +{ + app_wifi_main(); + app_mdns_main(); + + xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *)); + xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *)); + + register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame); + register_human_face_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame); + register_httpd(xQueueHttpFrame, NULL, true); +} diff --git a/examples/human_face_detection/web/partitions.csv b/examples/human_face_detection/web/partitions.csv new file mode 100644 index 0000000..d6fdf11 --- /dev/null +++ b/examples/human_face_detection/web/partitions.csv @@ -0,0 +1,5 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild +factory, app, factory, 0x010000, 3840K +nvs, data, nvs, 0x3D0000, 16K +fr, 32, 32, 0x3E0000, 128K diff --git a/examples/human_face_detection/web/sdkconfig.defaults b/examples/human_face_detection/web/sdkconfig.defaults new file mode 100644 index 0000000..23ba110 --- /dev/null +++ b/examples/human_face_detection/web/sdkconfig.defaults @@ -0,0 +1,18 @@ +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y + +CONFIG_SPIRAM_SPEED_80M=y + +CONFIG_ESP_WIFI_AP_SSID="Human Face Detection" + +CONFIG_ESP_TASK_WDT=n + +# Wait for esp-idf stable +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +CONFIG_SPIRAM_MEMTEST=n + +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" diff --git a/examples/human_face_detection/web/sdkconfig.defaults.esp32 b/examples/human_face_detection/web/sdkconfig.defaults.esp32 new file mode 100644 index 0000000..ecc2d87 --- /dev/null +++ b/examples/human_face_detection/web/sdkconfig.defaults.esp32 @@ -0,0 +1,4 @@ +CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32_SPIRAM_SUPPORT=y + +CONFIG_CAMERA_MODULE_ESP_EYE=y \ No newline at end of file diff --git a/examples/human_face_detection/web/sdkconfig.defaults.esp32s2 b/examples/human_face_detection/web/sdkconfig.defaults.esp32s2 new file mode 100644 index 0000000..3b5e99c --- /dev/null +++ b/examples/human_face_detection/web/sdkconfig.defaults.esp32s2 @@ -0,0 +1,7 @@ +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +CONFIG_ESP32S2_DATA_CACHE_16KB=y +ESP32S2_DATA_CACHE_LINE_32B=y + +CONFIG_CAMERA_MODULE_ESP_S2_KALUGA=y \ No newline at end of file diff --git a/examples/human_face_detection/web/sdkconfig.defaults.esp32s3 b/examples/human_face_detection/web/sdkconfig.defaults.esp32s3 new file mode 100644 index 0000000..d8033e2 --- /dev/null +++ b/examples/human_face_detection/web/sdkconfig.defaults.esp32s3 @@ -0,0 +1,11 @@ +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_SPIRAM_SUPPORT=y + +CONFIG_ESP32S3_DATA_CACHE_64KB=y +CONFIG_ESP32S3_DATA_CACHE_8WAYS=y +CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y + +CONFIG_CAMERA_MODULE_ESP_S3_EYE=y +CONFIG_ESPTOOLPY_NO_STUB=y +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y +CONFIG_SPIRAM_MODE_OCT=y