From f18561b57802ae158634765ef1a85c9972bc6af8 Mon Sep 17 00:00:00 2001 From: sty-yyj <40189936+sty-yyj@users.noreply.github.com> Date: Wed, 12 Jun 2019 22:21:55 +0800 Subject: [PATCH] Fix aug_test_rpn error (#737) * fixed a bug which causes merged_proposals are only from a certain scale of proposals in aug_test_rpn * add a comment and modify _img_metas to aug_img_metas --- mmdet/models/detectors/test_mixins.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mmdet/models/detectors/test_mixins.py b/mmdet/models/detectors/test_mixins.py index b64f2cd..9a179e9 100644 --- a/mmdet/models/detectors/test_mixins.py +++ b/mmdet/models/detectors/test_mixins.py @@ -17,10 +17,18 @@ class RPNTestMixin(object): proposal_list = self.simple_test_rpn(x, img_meta, rpn_test_cfg) for i, proposals in enumerate(proposal_list): aug_proposals[i].append(proposals) + # reorganize the order of 'img_metas' to match the dimensions + # of 'aug_proposals' + aug_img_metas = [] + for i in range(imgs_per_gpu): + aug_img_meta = [] + for j in range(len(img_metas)): + aug_img_meta.append(img_metas[j][i]) + aug_img_metas.append(aug_img_meta) # after merging, proposals will be rescaled to the original image size merged_proposals = [ - merge_aug_proposals(proposals, img_meta, rpn_test_cfg) - for proposals, img_meta in zip(aug_proposals, img_metas) + merge_aug_proposals(proposals, aug_img_meta, rpn_test_cfg) + for proposals, aug_img_meta in zip(aug_proposals, aug_img_metas) ] return merged_proposals -- GitLab