Skip to content
Snippets Groups Projects
Commit e033ef69 authored by Daniel Suess's avatar Daniel Suess Committed by Kai Chen
Browse files

Clip proposal boxes to valid range in single_mask_target (#1688)

* Clip proposal boxes to valid range in single_mask_target

* Fix the clipping value in mask_target_single
parent b96d2e03
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,9 @@ def mask_target_single(pos_proposals, pos_assigned_gt_inds, gt_masks, cfg):
mask_targets = []
if num_pos > 0:
proposals_np = pos_proposals.cpu().numpy()
_, maxh, maxw = gt_masks.shape
proposals_np[:, [0, 2]] = np.clip(proposals_np[:, [0, 2]], 0, maxw - 1)
proposals_np[:, [1, 3]] = np.clip(proposals_np[:, [1, 3]], 0, maxh - 1)
pos_assigned_gt_inds = pos_assigned_gt_inds.cpu().numpy()
for i in range(num_pos):
gt_mask = gt_masks[pos_assigned_gt_inds[i]]
......
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