From 726cebd3fb67d65ec6d2d49fa6bfba4c053085df Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 02 Apr 2018 12:02:53 +0000
Subject: [PATCH] Fixed detector recall

---
 src/detector.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/detector.c b/src/detector.c
index 4ec62cd..a6a5a5d 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -471,7 +471,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;
@@ -828,7 +828,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;

--
Gitblit v1.10.0