From 2ce6460c79e06caa33eab3991ee3e7fd9f0909d6 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Tue, 10 Apr 2018 18:08:24 +0000
Subject: [PATCH] Remove truth only if smaller than 1x1 pix during training
---
src/detector.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/detector.c b/src/detector.c
index 4ec62cd..25968e6 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -419,6 +419,7 @@
load_weights(&net, weightfile);
}
set_batch_network(&net, 1);
+ fuse_conv_batchnorm(net);
srand(time(0));
//list *plist = get_paths("data/coco_val_5k.list");
@@ -471,7 +472,7 @@
++total;
box t = { truth[j].x, truth[j].y, truth[j].w, truth[j].h };
float best_iou = 0;
- for (k = 0; k < l.w*l.h*l.n; ++k) {
+ for (k = 0; k < nboxes; ++k) {
float iou = box_iou(dets[k].bbox, t);
if (dets[k].objectness > thresh && iou > best_iou) {
best_iou = iou;
@@ -526,6 +527,7 @@
load_weights(&net, weightfile);
}
set_batch_network(&net, 1);
+ fuse_conv_batchnorm(net);
srand(time(0));
list *plist = get_paths(valid_images);
@@ -828,7 +830,7 @@
{
anchors_t a = *(anchors_t *)pa;
anchors_t b = *(anchors_t *)pb;
- float diff = b.w - a.w;
+ float diff = b.w*b.h - a.w*a.h;
if (diff < 0) return 1;
else if (diff > 0) return -1;
return 0;
@@ -1022,6 +1024,7 @@
load_weights(&net, weightfile);
}
set_batch_network(&net, 1);
+ fuse_conv_batchnorm(net);
srand(2222222);
clock_t time;
char buff[256];
@@ -1146,4 +1149,5 @@
demo(cfg, weights, thresh, hier_thresh, cam_index, filename, names, classes, frame_skip, prefix, out_filename,
http_stream_port, dont_show);
}
+ else printf(" There isn't such command: %s", argv[2]);
}
--
Gitblit v1.10.0