def apply_to_bbox(self,
                   bbox,
                   crop_height=0,
                   crop_width=0,
                   h_start=0,
                   w_start=0,
                   rows=0,
                   cols=0,
                   **params):
     return F.bbox_random_crop(bbox, crop_height, crop_width, h_start,
                               w_start, rows, cols)
 def apply_to_bbox(self, bbox, height=1024, width=1024, **params):
     return F.bbox_random_crop(bbox, height, width, **params)
Esempio n. 3
0
def test_bbox_random_crop():
    cropped_bbox = F.bbox_random_crop([0.5, 0.2, 0.9, 0.7], 80, 80, 0.2, 0.1,
                                      100, 100)
    assert cropped_bbox == [0.6, 0.2, 1.1, 0.825]