How to use the albumentations.augmentations.functional function in albumentations

To help you get started, we’ve selected a few albumentations examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github albumentations-team / albumentations / tests / test_keypoint.py View on Github external
def test_keypoint_rotate90(keypoint, expected, factor):
    actual = F.keypoint_rot90(keypoint, factor, rows=100, cols=200)
    assert actual == expected
github albumentations-team / albumentations / albumentations / augmentations / transforms.py View on Github external
def apply(self, image, **params):
        return F.linear_transformation_rgb(image, self.sepia_transformation_matrix)
github albumentations-team / albumentations / benchmark / benchmark.py View on Github external
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)
github albumentations-team / albumentations / albumentations / augmentations / transforms.py View on Github external
def apply(self, image, ksize=3, **params):
        return F.gaussian_blur(image, ksize)
github albumentations-team / albumentations / albumentations / augmentations / transforms.py View on Github external
def apply(self, img, **params):
        return F.from_float(img, self.dtype, self.max_value)
github albumentations-team / albumentations / albumentations / augmentations / transforms.py View on Github external
def apply(self, img, scale=0, interpolation=cv2.INTER_LINEAR, **params):
        return F.scale(img, scale, interpolation)
github albumentations-team / albumentations / albumentations / augmentations / transforms.py View on Github external
def apply(self, img, interpolation=cv2.INTER_LINEAR, **params):
        return F.smallest_max_size(img, max_size=self.max_size, interpolation=interpolation)
github albumentations-team / albumentations / albumentations / augmentations / transforms.py View on Github external
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)
github albumentations-team / albumentations / albumentations / augmentations / transforms.py View on Github external
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)