| 56 | return cropped_image, tform.params.T |
| 57 | |
| 58 | class Cropper(object): |
| 59 | def __init__(self, crop_size, scale=[1,1], trans_scale = 0.): |
| 60 | self.crop_size = crop_size |
| 61 | self.scale = scale |
| 62 | self.trans_scale = trans_scale |
| 63 | |
| 64 | def crop(self, image, points, points_scale=None): |
| 65 | # points to bbox |
| 66 | center, bbox_size = points2bbox(points, points_scale) |
| 67 | # argument bbox. |
| 68 | center, bbox_size = augment_bbox(center, bbox_size, scale=self.scale, trans_scale=self.trans_scale) |
| 69 | # crop |
| 70 | cropped_image, tform = crop_array(image, center, bbox_size, self.crop_size) |
| 71 | return cropped_image, tform |
| 72 |
nothing calls this directly
no outgoing calls
no test coverage detected