From c2c8595b083ec3586a99bb913b8a986e81e3a42a Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Thu, 19 Apr 2018 11:47:39 +0000
Subject: [PATCH] Fixed detection and validate(recall, map) for .png and .bmp images.
---
src/data.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/data.c b/src/data.c
index 1bb333a..a9dba1d 100644
--- a/src/data.c
+++ b/src/data.c
@@ -302,15 +302,15 @@
find_replace(labelpath, "raw", "labels", labelpath);
find_replace(labelpath, ".jpg", ".txt", labelpath);
find_replace(labelpath, ".png", ".txt", labelpath);
+ find_replace(labelpath, ".bmp", ".txt", labelpath);
find_replace(labelpath, ".JPG", ".txt", labelpath);
find_replace(labelpath, ".JPEG", ".txt", labelpath);
int count = 0;
int i;
box_label *boxes = read_boxes(labelpath, &count);
+ float lowest_w = 1.F / net_w;
+ float lowest_h = 1.F / net_h;
if (small_object == 1) {
- float lowest_w = 1.F / net_w;
- float lowest_h = 1.F / net_h;
- printf(" lowest_w = %f, lowest_h = %f \n", lowest_w, lowest_h);
for (i = 0; i < count; ++i) {
if (boxes[i].w < lowest_w) boxes[i].w = lowest_w;
if (boxes[i].h < lowest_h) boxes[i].h = lowest_h;
@@ -330,7 +330,9 @@
id = boxes[i].id;
// not detect small objects
- if ((w < 0.001F || h < 0.001F)) continue;
+ //if ((w < 0.001F || h < 0.001F)) continue;
+ // if truth (box for object) is smaller than 1x1 pix
+ if ((w < lowest_w || h < lowest_h)) continue;
truth[i*5+0] = x;
truth[i*5+1] = y;
--
Gitblit v1.10.0