From 22796c5a496a89e47dfafa68342e090d576c4866 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Sun, 10 Jun 2018 10:58:37 +0000
Subject: [PATCH] Minor fix

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

diff --git a/src/detector.c b/src/detector.c
index 0c0b14d..228647a 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -976,6 +976,7 @@
 	//for (i = 0; i < number_of_boxes; ++i)
 	//	printf("%2.2f,%2.2f, ", points->data.fl[i * 2], points->data.fl[i * 2 + 1]);
 
+	printf("\n");
 	float avg_iou = 0;
 	for (i = 0; i < number_of_boxes; ++i) {
 		float box_w = points->data.fl[i * 2];
@@ -999,7 +1000,7 @@
 		float box_intersect = min_w*min_h;
 		float box_union = box_w*box_h + anchor_w*anchor_h - box_intersect;
 		float iou = box_intersect / box_union;
-		if (iou > 1 || iou < 0) {
+		if (iou > 1 || iou < 0 || box_w > width || box_h > height) {
 			printf(" i = %d, box_w = %d, box_h = %d, anchor_w = %d, anchor_h = %d, iou = %f \n",
 				i, box_w, box_h, anchor_w, anchor_h, iou);
 		}

--
Gitblit v1.10.0