From 35ce8c25ea2ec3b1b3a0b22810412c83a97a5a2d Mon Sep 17 00:00:00 2001 From: "PJLAB\\huanghaian" <1286304229@qq.com> Date: Thu, 28 Oct 2021 19:12:35 +0800 Subject: [PATCH 1/4] Fix aug test error when the number of prediction bboxes is 0 --- mmdet/models/dense_heads/dense_test_mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmdet/models/dense_heads/dense_test_mixins.py b/mmdet/models/dense_heads/dense_test_mixins.py index 84bbe6f1109..6f5a6b55e73 100644 --- a/mmdet/models/dense_heads/dense_test_mixins.py +++ b/mmdet/models/dense_heads/dense_test_mixins.py @@ -93,7 +93,7 @@ def aug_test_bboxes(self, feats, img_metas, rescale=False): if merged_bboxes.numel() == 0: det_bboxes = torch.cat([merged_bboxes, merged_scores[:, None]], -1) - return det_bboxes, merged_labels + return [(det_bboxes, merged_labels), ] det_bboxes, keep_idxs = batched_nms(merged_bboxes, merged_scores, merged_labels, self.test_cfg.nms) From 55894dde21f5fcc8f0d5f1291826f71e27586ce0 Mon Sep 17 00:00:00 2001 From: "PJLAB\\huanghaian" <1286304229@qq.com> Date: Thu, 28 Oct 2021 19:48:48 +0800 Subject: [PATCH 2/4] test --- mmdet/models/detectors/single_stage.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mmdet/models/detectors/single_stage.py b/mmdet/models/detectors/single_stage.py index c375c72d69d..a6a59c5d253 100644 --- a/mmdet/models/detectors/single_stage.py +++ b/mmdet/models/detectors/single_stage.py @@ -99,6 +99,7 @@ def simple_test(self, img, img_metas, rescale=False): corresponds to each class. """ feat = self.extract_feat(img) + results_list = self.bbox_head.simple_test( feat, img_metas, rescale=rescale) bbox_results = [ From dc507a3696ab8ddf6f3bf0a18fa63b9de263b074 Mon Sep 17 00:00:00 2001 From: "PJLAB\\huanghaian" <1286304229@qq.com> Date: Thu, 28 Oct 2021 19:49:52 +0800 Subject: [PATCH 3/4] test --- mmdet/models/detectors/single_stage.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mmdet/models/detectors/single_stage.py b/mmdet/models/detectors/single_stage.py index a6a59c5d253..c375c72d69d 100644 --- a/mmdet/models/detectors/single_stage.py +++ b/mmdet/models/detectors/single_stage.py @@ -99,7 +99,6 @@ def simple_test(self, img, img_metas, rescale=False): corresponds to each class. """ feat = self.extract_feat(img) - results_list = self.bbox_head.simple_test( feat, img_metas, rescale=rescale) bbox_results = [ From e797f3d47d5706cd1abdd03bb64d128ce1ad1264 Mon Sep 17 00:00:00 2001 From: "PJLAB\\huanghaian" <1286304229@qq.com> Date: Fri, 29 Oct 2021 09:28:49 +0800 Subject: [PATCH 4/4] fix lint --- mmdet/models/dense_heads/dense_test_mixins.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mmdet/models/dense_heads/dense_test_mixins.py b/mmdet/models/dense_heads/dense_test_mixins.py index 6f5a6b55e73..3421548955d 100644 --- a/mmdet/models/dense_heads/dense_test_mixins.py +++ b/mmdet/models/dense_heads/dense_test_mixins.py @@ -93,7 +93,9 @@ def aug_test_bboxes(self, feats, img_metas, rescale=False): if merged_bboxes.numel() == 0: det_bboxes = torch.cat([merged_bboxes, merged_scores[:, None]], -1) - return [(det_bboxes, merged_labels), ] + return [ + (det_bboxes, merged_labels), + ] det_bboxes, keep_idxs = batched_nms(merged_bboxes, merged_scores, merged_labels, self.test_cfg.nms)