From d9f93548dd0052780253c871597c68009a19773d Mon Sep 17 00:00:00 2001 From: Davis King Date: Wed, 9 Aug 2017 21:42:14 -0400 Subject: [PATCH] Fixed a bug in the warning message about NMS overlap where it would sometimes false alarm. --- dlib/dnn/loss.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlib/dnn/loss.h b/dlib/dnn/loss.h index f485604ec..974f8d136 100644 --- a/dlib/dnn/loss.h +++ b/dlib/dnn/loss.h @@ -793,7 +793,7 @@ namespace dlib // So we didn't hit this truth box. Is that because there is // another, different truth box, that overlaps it according to NMS? const std::pair hittruth = find_best_match(*truth, (*truth)[i], i); - if (hittruth.second == i) + if (hittruth.second == i || (*truth)[hittruth.second].ignore) continue; rectangle best_matching_truth_box = (*truth)[hittruth.second]; if (options.overlaps_nms(best_matching_truth_box, (*truth)[i])) @@ -806,7 +806,8 @@ namespace dlib g[idx] = 0; std::cout << "Warning, ignoring object. We encountered a truth rectangle located at " << (*truth)[i].rect; std::cout << " that is suppressed by non-max-suppression "; - std::cout << "because it is overlapped by another truth rectangle located at " << best_matching_truth_box << "." << std::endl; + std::cout << "because it is overlapped by another truth rectangle located at " << best_matching_truth_box + << " (IoU:"<< box_intersection_over_union(best_matching_truth_box,(*truth)[i]) <<")." << std::endl; } } }