Crop around a reference bbox (cropping_bbox_key) with random shift (max_part_shift). Use when you have a region of interest to augment.
max_part_shiftMax shift in height and width dimensions relative
to cropping_bbox dimension.
If max_part_shift is a single float, the range will be (0, max_part_shift).
Default (0, 0.3).
cropping_bbox_keyAdditional target key for cropping box. Default cropping_bbox.
pprobability of applying the transform. Default: 1.
>>> aug = Compose([RandomCropNearBBox(max_part_shift=(0.1, 0.5), cropping_bbox_key='test_bbox')],
>>> bbox_params=BboxParams("pascal_voc"))
>>> result = aug(image=image, bboxes=bboxes, test_bbox=[0, 5, 10, 20])