From 3c561626648d334ce5791d839dfac75ddba00d01 Mon Sep 17 00:00:00 2001 From: AddSalt8227 <595311669@qq.com> Date: Sun, 20 Feb 2022 00:27:38 +0800 Subject: [PATCH] std::max_element in range [first, last) (#1285) --- examples/tm_yolact.cpp | 2 +- examples/tm_yolact_uint8.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tm_yolact.cpp b/examples/tm_yolact.cpp index d6e2263f..2f9bc008 100644 --- a/examples/tm_yolact.cpp +++ b/examples/tm_yolact.cpp @@ -204,7 +204,7 @@ static void fast_nms(std::vector >& class_candidates, std::v for (int j = 1; j < n; j++) { std::vector::iterator max_value; - max_value = std::max_element(iou_matrix[j].begin(), iou_matrix[j].begin() + j - 1); + max_value = std::max_element(iou_matrix[j].begin(), iou_matrix[j].begin() + j); if (*max_value <= iou_thresh) { objects.push_back(candidate[j]); diff --git a/examples/tm_yolact_uint8.cpp b/examples/tm_yolact_uint8.cpp index 630d1dfd..691cf454 100644 --- a/examples/tm_yolact_uint8.cpp +++ b/examples/tm_yolact_uint8.cpp @@ -212,7 +212,7 @@ static void fast_nms(std::vector >& class_candidates, std::v for (int j = 1; j < n; j++) { std::vector::iterator max_value; - max_value = std::max_element(iou_matrix[j].begin(), iou_matrix[j].begin() + j - 1); + max_value = std::max_element(iou_matrix[j].begin(), iou_matrix[j].begin() + j); if (*max_value <= iou_thresh) { objects.push_back(candidate[j]); -- GitLab