"tools/imglab/vscode:/vscode.git/clone" did not exist on "b5511d2cb381435d7dfda27f3fd04b1ff377f974"
Commit dcfedf54 authored by Cao Yuhang's avatar Cao Yuhang Committed by Kai Chen
Browse files

Add Crop seg to RandomCrop (#1880)

* add crop seg to RandomCrop trans

* minor fix comment
parent 16a6f7da
...@@ -378,6 +378,10 @@ class RandomCrop(object): ...@@ -378,6 +378,10 @@ class RandomCrop(object):
bboxes[:, 1::2] = np.clip(bboxes[:, 1::2], 0, img_shape[0] - 1) bboxes[:, 1::2] = np.clip(bboxes[:, 1::2], 0, img_shape[0] - 1)
results[key] = bboxes results[key] = bboxes
# crop semantic seg
for key in results.get('seg_fields', []):
results[key] = results[key][crop_y1:crop_y2, crop_x1:crop_x2]
# filter out the gt bboxes that are completely cropped # filter out the gt bboxes that are completely cropped
if 'gt_bboxes' in results: if 'gt_bboxes' in results:
gt_bboxes = results['gt_bboxes'] gt_bboxes = results['gt_bboxes']
......
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