From f6b66e4f2d8692fb6cacad5428f331d966a8b16d Mon Sep 17 00:00:00 2001 From: nianjiuhuiyi <64776403+nianjiuhuiyi@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:21:47 +0800 Subject: [PATCH] Update main.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正置信度不起作用的问题。 --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index 1dee322..3bed4a8 100644 --- a/main.py +++ b/main.py @@ -50,6 +50,9 @@ def post_processing(self, pred_boxes, scores, pred_classes, pred_masks, im_hw, p heights = pred_boxes[:, 3] - pred_boxes[:, 1] keep = (widths > threshold) & (heights > threshold) + condation = np.where(scores > self.confThreshold, True, False) + keep &= condation + pred_boxes = pred_boxes[keep] scores = scores[keep] pred_classes = pred_classes[keep]