Commit 144a7ec4 authored by gfjiangly's avatar gfjiangly Committed by Kai Chen
Browse files

fix bugs for cropping masks in RandomCrop (#1333)

* add g++ requirement for INSTALL.md.

* fix bugs for cropping masks in RandomCrop.

* simplify the code to fix bugs for cropping masks in RandomCrop.
parent c5c7ef90
......@@ -300,7 +300,7 @@ class Normalize(object):
@PIPELINES.register_module
class RandomCrop(object):
"""Random crop the image & bboxes.
"""Random crop the image & bboxes & masks.
Args:
crop_size (tuple): Expected size after cropping, (h, w).
......@@ -348,7 +348,7 @@ class RandomCrop(object):
# filter and crop the masks
if 'gt_masks' in results:
valid_gt_masks = []
for i in valid_inds:
for i in np.where(valid_inds)[0]:
gt_mask = results['gt_masks'][i][crop_y1:crop_y2, crop_x1:
crop_x2]
valid_gt_masks.append(gt_mask)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment