From 8ce0d8bdbad8dcf77a1224986ee09c6e61118d4e Mon Sep 17 00:00:00 2001 From: Ninenox Date: Tue, 22 Aug 2023 13:17:32 +0700 Subject: [PATCH] check pre-commit --- models/torch_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/torch_utils.py b/models/torch_utils.py index 0946d62..40e71cd 100644 --- a/models/torch_utils.py +++ b/models/torch_utils.py @@ -65,7 +65,7 @@ def det_postprocess(data: Tuple[Tensor, Tensor, Tensor, Tensor]): num_dets, bboxes, scores, labels = data[0][0], data[1][0], data[2][ 0], data[3][0] # check score negative - scores[scores < 0] = 1+scores[scores < 0] + scores[scores < 0] = 1 + scores[scores < 0] nums = num_dets.item() if nums == 0: return bboxes.new_zeros((0, 4)), scores.new_zeros( @@ -73,6 +73,7 @@ def det_postprocess(data: Tuple[Tensor, Tensor, Tensor, Tensor]): bboxes = bboxes[:nums] scores = scores[:nums] labels = labels[:nums] + # add nms idx = nms(bboxes, scores, iou_thres) bboxes, scores, labels = bboxes[idx], scores[idx], labels[idx]