Skip to content

Commit

Permalink
Free boxes (#122)
Browse files Browse the repository at this point in the history
* #120 Correctly free boxes
  • Loading branch information
easytarget authored Jun 8, 2021
1 parent 0cba55b commit e992269
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ static int run_face_recognition(dl_matrix3du_t *image_matrix, box_array_t *net_b
rgb_printf(image_matrix, FACE_COLOR_GREEN, "%s%u", knownFaceText, matched_id);
} else {
matched_id = -1;
Serial.print("FACE: no match found: ");
Serial.println("FACE: no match found:");
rgb_printf(image_matrix, FACE_COLOR_RED, "%s", unknownFaceText);
}
}
} else {
Serial.print("FACE: not aligned: ");
Serial.println("FACE: not aligned:");
rgb_print(image_matrix, FACE_COLOR_YELLOW, "???");
}

Expand Down Expand Up @@ -400,6 +400,10 @@ static esp_err_t capture_handler(httpd_req_t *req){
face_id = run_face_recognition(image_matrix, net_boxes);
}
draw_face_boxes(image_matrix, net_boxes, face_id);
dl_lib_free(net_boxes->score);
dl_lib_free(net_boxes->box);
dl_lib_free(net_boxes->landmark);
dl_lib_free(net_boxes);
}

jpg_chunking_t jchunk = {req, 0};
Expand Down Expand Up @@ -512,6 +516,10 @@ static esp_err_t stream_handler(httpd_req_t *req){
}
fr_recognize = esp_timer_get_time();
draw_face_boxes(image_matrix, net_boxes, face_id);
dl_lib_free(net_boxes->score);
dl_lib_free(net_boxes->box);
dl_lib_free(net_boxes->landmark);
dl_lib_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)){
Serial.println("STREAM: fmt2jpg failed");
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* Version of upstream code */

char baseVersion[] = "3.2";
char baseVersion[] = "3.2.1";

0 comments on commit e992269

Please sign in to comment.