imgaug helpers (albumentations.imgaug)

Transforms

class albumentations.imgaug.transforms.DualIAATransform(p)[source]
class albumentations.imgaug.transforms.ImageOnlyIAATransform(p=0.5)[source]
class albumentations.imgaug.transforms.IAAEmboss(alpha=(0.2, 0.5), strength=(0.2, 0.7), p=0.5)[source]

Emboss the input image and overlays the result with the original image.

Parameters:
  • alpha ((float, float)) – range to choose the visibility of the embossed image. At 0, only the original image is visible,at 1.0 only its embossed version is visible. Default: (0.2, 0.5).
  • strength ((float, float)) – strength range of the embossing. Default: (0.2, 0.7).
  • p (float) – probability of applying the transform. Default: 0.5.
Targets:
image
class albumentations.imgaug.transforms.IAASuperpixels(p_replace=0.1, n_segments=100, p=0.5)[source]

Completely or partially transform the input image to its superpixel representation. Uses skimage’s version of the SLIC algorithm. May be slow.

Parameters:
  • p_replace (float) – defines the probability of any superpixel area being replaced by the superpixel, i.e. by the average pixel color within its area. Default: 0.1.
  • n_segments (int) – target number of superpixels to generate. Default: 100.
  • p (float) – probability of applying the transform. Default: 0.5.
Targets:
image
class albumentations.imgaug.transforms.IAASharpen(alpha=(0.2, 0.5), lightness=(0.5, 1.0), p=0.5)[source]

Sharpen the input image and overlays the result with the original image.

Parameters:
  • alpha ((float, float)) – range to choose the visibility of the sharpened image. At 0, only the original image is visible, at 1.0 only its sharpened version is visible. Default: (0.2, 0.5).
  • lightness ((float, float)) – range to choose the lightness of the sharpened image. Default: (0.5, 1.0).
  • p (float) – probability of applying the transform. Default: 0.5.
Targets:
image
class albumentations.imgaug.transforms.IAAAdditiveGaussianNoise(loc=0, scale=(2.5500000000000003, 12.75), per_channel=False, p=0.5)[source]

Add gaussian noise to the input image.

Parameters:
  • loc (int) – mean of the normal distribution that generates the noise. Default: 0.
  • scale ((float, float)) – standard deviation of the normal distribution that generates the noise. Default: (0.01 * 255, 0.05 * 255).
  • p (float) – probability of applying the transform. Default: 0.5.
Targets:
image
class albumentations.imgaug.transforms.IAACropAndPad(px=None, percent=None, pad_mode='constant', pad_cval=0, keep_size=True, p=1)[source]
class albumentations.imgaug.transforms.IAAFliplr(p=0.5)[source]
class albumentations.imgaug.transforms.IAAFlipud(p=0.5)[source]
class albumentations.imgaug.transforms.IAAAffine(scale=1.0, translate_percent=None, translate_px=None, rotate=0.0, shear=0.0, order=1, cval=0, mode='reflect', p=0.5)[source]

Place a regular grid of points on the input and randomly move the neighbourhood of these point around via affine transformations.

Note: This class introduce interpolation artifacts to mask if it has values other than {0;1}

Parameters:p (float) – probability of applying the transform. Default: 0.5.
Targets:
image, mask
class albumentations.imgaug.transforms.IAAPiecewiseAffine(scale=0, nb_rows=4, nb_cols=4, order=1, cval=0, mode='constant', p=0.5)[source]

Place a regular grid of points on the input and randomly move the neighbourhood of these point around via affine transformations.

Note: This class introduce interpolation artifacts to mask if it has values other than {0;1}

Parameters:
  • scale ((float, float) – factor range that determines how far each point is moved. Default: (0.03, 0.05).
  • nb_rows (int) – number of rows of points that the regular grid should have. Default: 4.
  • nb_columns (int) – number of columns of points that the regular grid should have. Default: 4.
  • p (float) – probability of applying the transform. Default: 0.5.
Targets:
image, mask
class albumentations.imgaug.transforms.IAAPerspective(scale=(0.05, 0.1), keep_size=True, p=0.5)[source]

Perform a random four point perspective transform of the input.

Note: This class introduce interpolation artifacts to mask if it has values other than {0;1}

Parameters:
  • scale ((float, float) – standard deviation of the normal distributions. These are used to sample the random distances of the subimage’s corners from the full image’s corners. Default: (0.05, 0.1).
  • p (float) – probability of applying the transform. Default: 0.5.
Targets:
image, mask