Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zytx121 committed Nov 9, 2022
1 parent 4bbef14 commit ed2cf24
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion mmrotate/models/dense_heads/oriented_reppoints_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,11 @@ def _point_target_single(self,
# map up to original set of proposals
if unmap_outputs:
num_total_proposals = flat_proposals.size(0)
labels = unmap(labels, num_total_proposals, inside_flags)
labels = unmap(
labels,
num_total_proposals,
inside_flags,
fill=self.num_classes) # fill bg label
label_weights = unmap(label_weights, num_total_proposals,
inside_flags)
bbox_gt = unmap(bbox_gt, num_total_proposals, inside_flags)
Expand Down
6 changes: 5 additions & 1 deletion mmrotate/models/dense_heads/rotated_reppoints_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,11 @@ def _point_target_single(self,
# map up to original set of proposals
if unmap_outputs:
num_total_proposals = flat_proposals.size(0)
labels = unmap(labels, num_total_proposals, inside_flags)
labels = unmap(
labels,
num_total_proposals,
inside_flags,
fill=self.num_classes) # fill bg label
label_weights = unmap(label_weights, num_total_proposals,
inside_flags)
bbox_gt = unmap(bbox_gt, num_total_proposals, inside_flags)
Expand Down
6 changes: 5 additions & 1 deletion mmrotate/models/dense_heads/sam_reppoints_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,11 @@ def _point_target_single(self,
# map up to original set of proposals
if unmap_outputs:
num_total_proposals = flat_proposals.size(0)
labels = unmap(labels, num_total_proposals, inside_flags)
labels = unmap(
labels,
num_total_proposals,
inside_flags,
fill=self.num_classes) # fill bg label
label_weights = unmap(label_weights, num_total_proposals,
inside_flags)
bbox_gt = unmap(bbox_gt, num_total_proposals, inside_flags)
Expand Down

0 comments on commit ed2cf24

Please sign in to comment.