From f69a1599a7329fef9614eb0ff54ccf16d3722b8c Mon Sep 17 00:00:00 2001 From: XiaochaoGONG Date: Wed, 5 Dec 2018 16:48:45 +0800 Subject: [PATCH] Open face detection and recognition forward --- components/component_conf.mk | 4 ++-- components/esp-face | 2 +- .../camera_web_server/main/app_camera.c | 15 +++++++++++++++ .../camera_web_server/main/app_httpd.c | 6 ++++-- .../main/include/app_facenet.h | 2 +- .../main/include/app_facenet.h | 4 ++-- 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/components/component_conf.mk b/components/component_conf.mk index 20ea0da..7fea269 100644 --- a/components/component_conf.mk +++ b/components/component_conf.mk @@ -1,5 +1,5 @@ EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/lib EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/image_util -EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/face_detection/fd_coefficients -EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/face_recognition/fr_coefficients +EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/face_detection +EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/face_recognition diff --git a/components/esp-face b/components/esp-face index 822bdfd..3b87cf0 160000 --- a/components/esp-face +++ b/components/esp-face @@ -1 +1 @@ -Subproject commit 822bdfd483d4115e0025b7a3964fb8dd8d3a9343 +Subproject commit 3b87cf09ba22386fe580b5260bac25bab2f3ecc2 diff --git a/examples/single_chip/camera_web_server/main/app_camera.c b/examples/single_chip/camera_web_server/main/app_camera.c index 0ad407c..6b35b74 100755 --- a/examples/single_chip/camera_web_server/main/app_camera.c +++ b/examples/single_chip/camera_web_server/main/app_camera.c @@ -29,6 +29,21 @@ static const char *TAG = "app_camera"; void app_camera_main () { +#if CONFIG_CAMERA_MODEL_CUSTOM + /* IO13, IO14 is designed for JTAG by default, + * to use it as generalized input, + * firstly declair it as pullup input */ + gpio_config_t conf; + conf.mode = GPIO_MODE_INPUT; + conf.pull_up_en = GPIO_PULLUP_ENABLE; + conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + conf.intr_type = GPIO_INTR_DISABLE; + conf.pin_bit_mask = 1LL << 13; + gpio_config(&conf); + conf.pin_bit_mask = 1LL << 14; +#endif + + gpio_config(&conf); camera_config_t config; config.ledc_channel = LEDC_CHANNEL_0; config.ledc_timer = LEDC_TIMER_0; diff --git a/examples/single_chip/camera_web_server/main/app_httpd.c b/examples/single_chip/camera_web_server/main/app_httpd.c index 4440724..a3999dc 100644 --- a/examples/single_chip/camera_web_server/main/app_httpd.c +++ b/examples/single_chip/camera_web_server/main/app_httpd.c @@ -29,10 +29,10 @@ static const char* TAG = "camera_httpd"; #endif #if CONFIG_ESP_FACE_DETECT_ENABLED -#include "face_detection_forward.h" +#include "fd_forward.h" #include "dl_lib.h" #if CONFIG_ESP_FACE_RECOGNITION_ENABLED -#include "face_recognition.h" +#include "fr_forward.h" #define ENROLL_CONFIRM_TIMES 5 #define FACE_ID_SAVE_NUMBER 7 @@ -323,6 +323,7 @@ static esp_err_t capture_handler(httpd_req_t *req){ #endif draw_face_boxes(image_matrix, net_boxes, face_id); free(net_boxes->box); + free(net_boxes->landmark); free(net_boxes); } @@ -428,6 +429,7 @@ static esp_err_t stream_handler(httpd_req_t *req){ #endif draw_face_boxes(image_matrix, net_boxes, face_id); free(net_boxes->box); + free(net_boxes->landmark); free(net_boxes); } if(!fmt2jpg(image_matrix->item, fb->width*fb->height*3, fb->width, fb->height, PIXFORMAT_RGB888, 90, &_jpg_buf, &_jpg_buf_len)){ diff --git a/examples/single_chip/detection_with_command_line/main/include/app_facenet.h b/examples/single_chip/detection_with_command_line/main/include/app_facenet.h index b8696d7..6d65acd 100644 --- a/examples/single_chip/detection_with_command_line/main/include/app_facenet.h +++ b/examples/single_chip/detection_with_command_line/main/include/app_facenet.h @@ -28,7 +28,7 @@ extern "C" { #endif -#include "face_detection_forward.h" +#include "fd_forward.h" #include "image_util.h" #include "app_camera.h" diff --git a/examples/single_chip/recognition_with_command_line/main/include/app_facenet.h b/examples/single_chip/recognition_with_command_line/main/include/app_facenet.h index 571b0a9..d734db6 100644 --- a/examples/single_chip/recognition_with_command_line/main/include/app_facenet.h +++ b/examples/single_chip/recognition_with_command_line/main/include/app_facenet.h @@ -29,8 +29,8 @@ extern "C" { #endif -#include "face_detection_forward.h" -#include "face_recognition.h" +#include "fd_forward.h" +#include "fr_forward.h" #include "image_util.h" #include "app_camera.h"