@@ -229,6 +229,7 @@ static esp_err_t capture_handler(httpd_req_t *req){
229
229
230
230
httpd_resp_set_type (req, " image/jpeg" );
231
231
httpd_resp_set_hdr (req, " Content-Disposition" , " inline; filename=capture.jpg" );
232
+ httpd_resp_set_hdr (req, " Access-Control-Allow-Origin" , " *" );
232
233
233
234
size_t out_len, out_width, out_height;
234
235
uint8_t * out_buf;
@@ -282,6 +283,7 @@ static esp_err_t capture_handler(httpd_req_t *req){
282
283
face_id = run_face_recognition (image_matrix, net_boxes);
283
284
}
284
285
draw_face_boxes (image_matrix, net_boxes, face_id);
286
+ free (net_boxes->score );
285
287
free (net_boxes->box );
286
288
free (net_boxes->landmark );
287
289
free (net_boxes);
@@ -325,6 +327,8 @@ static esp_err_t stream_handler(httpd_req_t *req){
325
327
return res;
326
328
}
327
329
330
+ httpd_resp_set_hdr (req, " Access-Control-Allow-Origin" , " *" );
331
+
328
332
while (true ){
329
333
detected = false ;
330
334
face_id = 0 ;
@@ -378,6 +382,7 @@ static esp_err_t stream_handler(httpd_req_t *req){
378
382
}
379
383
fr_recognize = esp_timer_get_time ();
380
384
draw_face_boxes (image_matrix, net_boxes, face_id);
385
+ free (net_boxes->score );
381
386
free (net_boxes->box );
382
387
free (net_boxes->landmark );
383
388
free (net_boxes);
@@ -624,15 +629,18 @@ void startCameraServer(){
624
629
625
630
ra_filter_init (&ra_filter, 20 );
626
631
632
+ mtmn_config.type = FAST;
627
633
mtmn_config.min_face = 80 ;
628
- mtmn_config.pyramid = 0.7 ;
634
+ mtmn_config.pyramid = 0.707 ;
635
+ mtmn_config.pyramid_times = 4 ;
629
636
mtmn_config.p_threshold .score = 0.6 ;
630
637
mtmn_config.p_threshold .nms = 0.7 ;
638
+ mtmn_config.p_threshold .candidate_number = 20 ;
631
639
mtmn_config.r_threshold .score = 0.7 ;
632
640
mtmn_config.r_threshold .nms = 0.7 ;
633
- mtmn_config.r_threshold .candidate_number = 4 ;
641
+ mtmn_config.r_threshold .candidate_number = 10 ;
634
642
mtmn_config.o_threshold .score = 0.7 ;
635
- mtmn_config.o_threshold .nms = 0.4 ;
643
+ mtmn_config.o_threshold .nms = 0.7 ;
636
644
mtmn_config.o_threshold .candidate_number = 1 ;
637
645
638
646
face_id_init (&id_list, FACE_ID_SAVE_NUMBER, ENROLL_CONFIRM_TIMES);
0 commit comments