diff --git a/components/esp-face b/components/esp-face index 08ba977..9f64994 160000 --- a/components/esp-face +++ b/components/esp-face @@ -1 +1 @@ -Subproject commit 08ba977a6ccf5ab7868bd30af60b3f1702a1a9d2 +Subproject commit 9f64994450feeebc92350d9a66ab5b29d9fce2f4 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 de414b8..c450642 100644 --- a/examples/single_chip/camera_web_server/main/app_httpd.c +++ b/examples/single_chip/camera_web_server/main/app_httpd.c @@ -310,6 +310,7 @@ static esp_err_t capture_handler(httpd_req_t *req){ } #endif draw_face_boxes(image_matrix, net_boxes, face_id); + free(net_boxes->score); free(net_boxes->box); free(net_boxes->landmark); free(net_boxes); @@ -416,6 +417,7 @@ static esp_err_t stream_handler(httpd_req_t *req){ fr_recognize = esp_timer_get_time(); #endif draw_face_boxes(image_matrix, net_boxes, face_id); + free(net_boxes->score); free(net_boxes->box); free(net_boxes->landmark); free(net_boxes); @@ -691,16 +693,18 @@ void app_httpd_main(){ ra_filter_init(&ra_filter, 20); #if CONFIG_ESP_FACE_DETECT_ENABLED + mtmn_config.type = FAST; mtmn_config.min_face = 80; - mtmn_config.pyramid = 0.7; + mtmn_config.pyramid = 0.707; + mtmn_config.pyramid_times = 4; mtmn_config.p_threshold.score = 0.6; mtmn_config.p_threshold.nms = 0.7; - mtmn_config.p_threshold.candidate_number = 100; + mtmn_config.p_threshold.candidate_number = 20; mtmn_config.r_threshold.score = 0.7; mtmn_config.r_threshold.nms = 0.7; - mtmn_config.r_threshold.candidate_number = 4; + mtmn_config.r_threshold.candidate_number = 10; mtmn_config.o_threshold.score = 0.7; - mtmn_config.o_threshold.nms = 0.4; + mtmn_config.o_threshold.nms = 0.7; mtmn_config.o_threshold.candidate_number = 1; #if CONFIG_ESP_FACE_RECOGNITION_ENABLED face_id_init(&id_list, FACE_ID_SAVE_NUMBER, ENROLL_CONFIRM_TIMES); diff --git a/examples/single_chip/detection_with_command_line/main/app_facenet.c b/examples/single_chip/detection_with_command_line/main/app_facenet.c index 06bc4b6..3335a13 100644 --- a/examples/single_chip/detection_with_command_line/main/app_facenet.c +++ b/examples/single_chip/detection_with_command_line/main/app_facenet.c @@ -33,16 +33,18 @@ static const char *TAG = "app_process"; mtmn_config_t init_config() { mtmn_config_t mtmn_config = {0}; + mtmn_config.type = FAST; mtmn_config.min_face = 80; - mtmn_config.pyramid = 0.7; + mtmn_config.pyramid = 0.707; + mtmn_config.pyramid_times = 4; mtmn_config.p_threshold.score = 0.6; mtmn_config.p_threshold.nms = 0.7; - mtmn_config.p_threshold.candidate_number = 100; + mtmn_config.p_threshold.candidate_number = 20; mtmn_config.r_threshold.score = 0.7; mtmn_config.r_threshold.nms = 0.7; - mtmn_config.r_threshold.candidate_number = 4; + mtmn_config.r_threshold.candidate_number = 10; mtmn_config.o_threshold.score = 0.7; - mtmn_config.o_threshold.nms = 0.4; + mtmn_config.o_threshold.nms = 0.7; mtmn_config.o_threshold.candidate_number = 1; return mtmn_config; @@ -85,6 +87,7 @@ void task_process (void *arg) { frame_num++; ESP_LOGI(TAG, "DETECTED: %d\n", frame_num); + free(net_boxes->score); free(net_boxes->box); free(net_boxes->landmark); free(net_boxes); diff --git a/examples/single_chip/recognition_solution/main/app_camera.c b/examples/single_chip/recognition_solution/main/app_camera.c index 55aa7c1..3fa1f82 100644 --- a/examples/single_chip/recognition_solution/main/app_camera.c +++ b/examples/single_chip/recognition_solution/main/app_camera.c @@ -70,4 +70,13 @@ void app_camera_init() ESP_LOGE(TAG, "Camera init failed with error 0x%x", err); return; } + + sensor_t *s = esp_camera_sensor_get(); + //initial sensors are flipped vertically and colors are a bit saturated + if (s->id.PID == OV3660_PID) + { + s->set_vflip(s, 1); //flip it back + s->set_brightness(s, 1); //up the blightness just a bit + s->set_saturation(s, -2); //lower the saturation + } } diff --git a/examples/single_chip/recognition_solution/main/app_httpserver.c b/examples/single_chip/recognition_solution/main/app_httpserver.c index e78352f..5252bc9 100644 --- a/examples/single_chip/recognition_solution/main/app_httpserver.c +++ b/examples/single_chip/recognition_solution/main/app_httpserver.c @@ -283,6 +283,7 @@ esp_err_t facenet_stream_handler(httpd_req_t *req) } draw_face_boxes(image_matrix, net_boxes); + free(net_boxes->score); free(net_boxes->box); free(net_boxes->landmark); free(net_boxes); diff --git a/examples/single_chip/recognition_wechat/main/app_camera.c b/examples/single_chip/recognition_wechat/main/app_camera.c index 55aa7c1..3fa1f82 100644 --- a/examples/single_chip/recognition_wechat/main/app_camera.c +++ b/examples/single_chip/recognition_wechat/main/app_camera.c @@ -70,4 +70,13 @@ void app_camera_init() ESP_LOGE(TAG, "Camera init failed with error 0x%x", err); return; } + + sensor_t *s = esp_camera_sensor_get(); + //initial sensors are flipped vertically and colors are a bit saturated + if (s->id.PID == OV3660_PID) + { + s->set_vflip(s, 1); //flip it back + s->set_brightness(s, 1); //up the blightness just a bit + s->set_saturation(s, -2); //lower the saturation + } } diff --git a/examples/single_chip/recognition_wechat/main/app_facenet.c b/examples/single_chip/recognition_wechat/main/app_facenet.c index d02444a..68ec43a 100644 --- a/examples/single_chip/recognition_wechat/main/app_facenet.c +++ b/examples/single_chip/recognition_wechat/main/app_facenet.c @@ -37,16 +37,18 @@ extern QueueHandle_t gpst_output; static inline mtmn_config_t app_mtmn_config() { mtmn_config_t mtmn_config; + mtmn_config.type = FAST; mtmn_config.min_face = 80; - mtmn_config.pyramid = 0.7; + mtmn_config.pyramid = 0.707; + mtmn_config.pyramid_times = 4; mtmn_config.p_threshold.score = 0.6; mtmn_config.p_threshold.nms = 0.7; - mtmn_config.p_threshold.candidate_number = 100; - mtmn_config.r_threshold.score = 0.6; + mtmn_config.p_threshold.candidate_number = 20; + mtmn_config.r_threshold.score = 0.7; mtmn_config.r_threshold.nms = 0.7; - mtmn_config.r_threshold.candidate_number = 4; - mtmn_config.o_threshold.score = 0.6; - mtmn_config.o_threshold.nms = 0.4; + mtmn_config.r_threshold.candidate_number = 10; + mtmn_config.o_threshold.score = 0.7; + mtmn_config.o_threshold.nms = 0.7; mtmn_config.o_threshold.candidate_number = 1; return mtmn_config; diff --git a/examples/single_chip/recognition_with_command_line/main/app_facenet.c b/examples/single_chip/recognition_with_command_line/main/app_facenet.c index be0d698..4fa32ea 100644 --- a/examples/single_chip/recognition_with_command_line/main/app_facenet.c +++ b/examples/single_chip/recognition_with_command_line/main/app_facenet.c @@ -52,15 +52,18 @@ char *number_suffix(int32_t number) mtmn_config_t init_config() { mtmn_config_t mtmn_config = {0}; + mtmn_config.type = FAST; mtmn_config.min_face = 80; - mtmn_config.pyramid = 0.7; + mtmn_config.pyramid = 0.707; + mtmn_config.pyramid_times = 4; mtmn_config.p_threshold.score = 0.6; mtmn_config.p_threshold.nms = 0.7; + mtmn_config.p_threshold.candidate_number = 20; mtmn_config.r_threshold.score = 0.7; mtmn_config.r_threshold.nms = 0.7; - mtmn_config.r_threshold.candidate_number = 4; + mtmn_config.r_threshold.candidate_number = 10; mtmn_config.o_threshold.score = 0.7; - mtmn_config.o_threshold.nms = 0.4; + mtmn_config.o_threshold.nms = 0.7; mtmn_config.o_threshold.candidate_number = 1; return mtmn_config; @@ -174,6 +177,7 @@ void task_process(void *arg) ESP_LOGI(TAG, "Detected face is not proper."); } + free(net_boxes->score); free(net_boxes->box); free(net_boxes->landmark); free(net_boxes);