|
|
|
@ -105,7 +105,7 @@ double get_wall_time() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int cam_index, const char *filename, char **names, int classes, |
|
|
|
|
int frame_skip, char *prefix, char *out_filename, int mjpeg_port, int json_port, int dont_show, int ext_output, int letter_box_in, int time_limit_sec) |
|
|
|
|
int frame_skip, char *prefix, char *out_filename, int mjpeg_port, int json_port, int dont_show, int ext_output, int letter_box_in, int time_limit_sec, char *http_post_host) |
|
|
|
|
{ |
|
|
|
|
letter_box = letter_box_in; |
|
|
|
|
in_img = det_img = show_img = NULL; |
|
|
|
@ -201,6 +201,7 @@ void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int |
|
|
|
|
//'W', 'M', 'V', '2'
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int send_http_post_once = 0; |
|
|
|
|
const double start_time_lim = get_time_point(); |
|
|
|
|
double before = get_wall_time(); |
|
|
|
|
|
|
|
|
@ -231,6 +232,17 @@ void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int |
|
|
|
|
send_json(local_dets, local_nboxes, l.classes, demo_names, frame_id, demo_json_port, timeout); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//char *http_post_server = "webhook.site/898bbd9b-0ddd-49cf-b81d-1f56be98d870";
|
|
|
|
|
if (http_post_host && !send_http_post_once) { |
|
|
|
|
int timeout = 3; // 3 seconds
|
|
|
|
|
int http_post_port = 80; // 443 https, 80 http
|
|
|
|
|
if (send_http_post_request(http_post_host, http_post_port, filename, |
|
|
|
|
dets, nboxes, classes, names, frame_id, ext_output, timeout)) |
|
|
|
|
{ |
|
|
|
|
if (time_limit_sec > 0) send_http_post_once = 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
draw_detections_cv_v3(show_img, local_dets, local_nboxes, demo_thresh, demo_names, demo_alphabet, demo_classes, demo_ext_output); |
|
|
|
|
free_detections(local_dets, local_nboxes); |
|
|
|
|
|
|
|
|
@ -332,7 +344,7 @@ void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
|
void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int cam_index, const char *filename, char **names, int classes, |
|
|
|
|
int frame_skip, char *prefix, char *out_filename, int mjpeg_port, int json_port, int dont_show, int ext_output, int letter_box_in, int time_limit_sec) |
|
|
|
|
int frame_skip, char *prefix, char *out_filename, int mjpeg_port, int json_port, int dont_show, int ext_output, int letter_box_in, int time_limit_sec, char *http_post_host) |
|
|
|
|
{ |
|
|
|
|
fprintf(stderr, "Demo needs OpenCV for webcam images.\n"); |
|
|
|
|
} |
|
|
|
|