Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_keypoint_rotate90(keypoint, expected, factor):
actual = F.keypoint_rot90(keypoint, factor, rows=100, cols=200)
assert actual == expected
def apply(self, img, **params):
return F.vflip(img)
def apply(self, image, **params):
return F.linear_transformation_rgb(image, self.sepia_transformation_matrix)
def albumentations(self, img):
if img.ndim == 3 and img.shape[2] > 1 and img.dtype == np.uint8:
return albumentations.hflip_cv2(img)
else:
return albumentations.hflip(img)
def apply(self, image, ksize=3, **params):
return F.gaussian_blur(image, ksize)
def apply(self, img, **params):
return F.from_float(img, self.dtype, self.max_value)
def apply(self, img, scale=0, interpolation=cv2.INTER_LINEAR, **params):
return F.scale(img, scale, interpolation)
def apply(self, img, interpolation=cv2.INTER_LINEAR, **params):
return F.smallest_max_size(img, max_size=self.max_size, interpolation=interpolation)
def apply_to_bbox(self, bbox, angle, scale, dx, dy, interpolation=cv2.INTER_LINEAR, **params):
return F.bbox_shift_scale_rotate(bbox, angle, scale, dx, dy, interpolation=cv2.INTER_LINEAR, **params)
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)