Skip to content
Snippets Groups Projects
Commit f18561b5 authored by sty-yyj's avatar sty-yyj Committed by Kai Chen
Browse files

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
parent 7715f235
No related branches found
No related tags found
No related merge requests found
...@@ -17,10 +17,18 @@ class RPNTestMixin(object): ...@@ -17,10 +17,18 @@ class RPNTestMixin(object):
proposal_list = self.simple_test_rpn(x, img_meta, rpn_test_cfg) proposal_list = self.simple_test_rpn(x, img_meta, rpn_test_cfg)
for i, proposals in enumerate(proposal_list): for i, proposals in enumerate(proposal_list):
aug_proposals[i].append(proposals) 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 # after merging, proposals will be rescaled to the original image size
merged_proposals = [ merged_proposals = [
merge_aug_proposals(proposals, img_meta, rpn_test_cfg) merge_aug_proposals(proposals, aug_img_meta, rpn_test_cfg)
for proposals, img_meta in zip(aug_proposals, img_metas) for proposals, aug_img_meta in zip(aug_proposals, aug_img_metas)
] ]
return merged_proposals return merged_proposals
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment