From 028696bf15efeca3acb3db8c42a96f7b9e0f55ff Mon Sep 17 00:00:00 2001
From: iovodov <b@ovdv.ru>
Date: Thu, 03 May 2018 13:33:46 +0000
Subject: [PATCH] Output improvements for detector results: When printing detector results, output was done in random order, obfuscating results for interpreting. Now: 1. Text output includes coordinates of rects in (left,right,top,bottom in pixels) along with label and score 2. Text output is sorted by rect lefts to simplify finding appropriate rects on image 3. If several class probs are > thresh for some detection, the most probable is written first and coordinates for others are not repeated 4. Rects are imprinted in image in order by their best class prob, so most probable rects are always on top and not overlayed by less probable ones 5. Most probable label for rect is always written first Also: 6. Message about low GPU memory include required amount
---
src/demo.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/demo.c b/src/demo.c
index 3b4e92d..4aee54f 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -24,6 +24,7 @@
#ifndef CV_VERSION_EPOCH
#include "opencv2/videoio/videoio_c.h"
#endif
+#include "http_stream.h"
image get_image_from_stream(CvCapture *cap);
static char **demo_names;
@@ -102,7 +103,7 @@
int letter = 0;
int nboxes = 0;
detection *dets = get_network_boxes(&net, det.w, det.h, demo_thresh, demo_thresh, 0, 1, &nboxes, letter);
- if (nms) do_nms_obj_v3(dets, nboxes, l.classes, nms);
+ if (nms) do_nms_obj(dets, nboxes, l.classes, nms);
printf("\033[2J");
printf("\033[1;1H");
@@ -143,12 +144,12 @@
demo_classes = classes;
demo_thresh = thresh;
printf("Demo\n");
- net = parse_network_cfg_custom(cfgfile, 1);
+ net = parse_network_cfg_custom(cfgfile, 1); // set batch=1
if(weightfile){
load_weights(&net, weightfile);
}
- set_batch_network(&net, 1);
-
+ //set_batch_network(&net, 1);
+ fuse_conv_batchnorm(net);
srand(2222222);
if(filename){
@@ -313,7 +314,8 @@
}
}
#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 http_stream_port, int dont_show)
+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 http_stream_port, int dont_show)
{
fprintf(stderr, "Demo needs OpenCV for webcam images.\n");
}
--
Gitblit v1.10.0