From 87d1f523ae6f229f2a866d6bd9850580cd5e0c3f Mon Sep 17 00:00:00 2001 From: Minhaz Palasara Date: Tue, 29 Jan 2019 19:06:40 -0500 Subject: [PATCH] Fixing NMS output filtering based on threshold --- src/caffe/util/bbox_util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/caffe/util/bbox_util.cpp b/src/caffe/util/bbox_util.cpp index 27f62bb42..92f79a2de 100644 --- a/src/caffe/util/bbox_util.cpp +++ b/src/caffe/util/bbox_util.cpp @@ -2263,7 +2263,7 @@ void GetMaxScoreIndex(const vector& scores, const float threshold, #endif for (int i = 0; i < scores.size(); ++i) { if (scores[i] > threshold) { - score_index_vec->at(i) = std::make_pair(scores[i], i); + score_index_vec->push_back(std::make_pair(scores[i], i)); } } @@ -2424,7 +2424,7 @@ void ApplyNMSFast(const vector& bboxes, CHECK_EQ(bboxes.size(), scores.size()) << "bboxes and scores have different size."; // Get top_k scores (with corresponding indices). - vector > score_index_vec(scores.size()); + vector > score_index_vec; GetMaxScoreIndex(scores, score_threshold, top_k, &score_index_vec); // Do nms. float adaptive_threshold = nms_threshold;