Skip to content

Commit

Permalink
fix: fix TypeError in ROI subsampling function (open-mmlab#893)
Browse files Browse the repository at this point in the history
* fix TypeError in ROI subsampling function

* add comment
  • Loading branch information
julianschoep authored Mar 29, 2022
1 parent a35f429 commit 1d5dac7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def subsample_rois(self, max_overlaps):
rand_num = np.floor(np.random.rand(self.roi_sampler_cfg.ROI_PER_IMAGE) * fg_num_rois)
rand_num = torch.from_numpy(rand_num).type_as(max_overlaps).long()
fg_inds = fg_inds[rand_num]
bg_inds = []
bg_inds = fg_inds[fg_inds < 0] # yield empty tensor

elif bg_num_rois > 0 and fg_num_rois == 0:
# sampling bg
Expand Down

0 comments on commit 1d5dac7

Please sign in to comment.