From c1002c09a882bee5f3a617c7ac0e726049bbfd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haian=20Huang=28=E6=B7=B1=E5=BA=A6=E7=9C=B8=29?= <1286304229@qq.com> Date: Tue, 2 Nov 2021 21:19:06 +0800 Subject: [PATCH] Fix aug test error when the number of prediction bboxes is 0 (#6398) * Fix aug test error when the number of prediction bboxes is 0 * test * test * 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 84bbe6f1109..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)