Skip to content

Available Transforms#

Preprocessing#

crop#

Crop a rectangular region from image.

Parameters:

name required type default minimum maximum
xMin True int 0
yMin True int 0
xMax True int 0
yMax True int 0

rescaleWithPadding#

Rescales the input image to fit into a rectangle of size height x width while maintaining aspect ratio and padding the rest of the rectangle with a constant value.

Parameters:

name required type default minimum maximum
height True int 1
width True int 1
paddingValue False int 0 0 255

resize#

Resize image.

Parameters:

name required type default minimum maximum
height True int 1
width True int 1

Augmentations#

blur#

Blurs images on a scale from 3 to 100

Parameters:

name required type default minimum maximum
lowerLimit False int 3 3 100
upperLimit False int 7 5 100
p False float 0.5 0 1
alwaysApply False bool False

gaussianBlur#

Makes the entire image look like it's out of focus. Blurred using a Gaussian filter to remove outlier pixels that may be noise in an image.

Parameters:

name required type default minimum maximum
lowerLimit False int 3 3 100
upperLimit False int 7 5 100
p False float 0.5 0 1

horizontalFlip#

Flip images horizontally, i.e., mirror the image.

Parameters:

name required type default minimum maximum
p False float 0.5 0 1

hueSaturationValue#

Randomly change hue, saturation and value of the input image.

Parameters:

name required type default minimum maximum
hueShiftLowerLimit False int -20 -255 255
hueShiftUpperLimit False int 20 -255 255
satShiftLowerLimit False int -30 -255 255
satShiftUpperLimit False int 30 -255 255
valShiftLowerLimit False int -20 -255 255
valShiftUpperLimit False int 20 -255 255
p False float 0.5 0 1

motionBlur#

Makes the image look like the subject or camera is in motion.

Parameters:

name required type default minimum maximum
lowerLimit False int 3 3 100
upperLimit False int 7 5 100
p False float 0.5 0 1

randAugment#

Applies a random list of augmentations to each image. This augmentation policy has been known to make the models generalize better.

Parameters:

name required type default minimum maximum
numberTransforms False int 1 1 10
magnitude False float 4 0 10
p False float 1 0 1
alwaysApply False bool False

randomBrightness#

Randomly change image brightness up or down.

Parameters:

name required type default minimum maximum
lowerLimit False float -0.2 -1 1
upperLimit False float 0.2 -1 1
p False float 0.5 0 1
alwaysApply False bool 0

randomContrast#

Randomly change image contrast up or down.

Parameters:

name required type default minimum maximum
lowerLimit False float -0.2 -1 1
upperLimit False float 0.2 -1 1
p False float 0.5 0 1
alwaysApply False bool 0

randomRotate90#

Randomly rotates images as well as their annotations 90 degrees clockwise or counterclockwise.

Parameters:

name required type default minimum maximum
p False float 0.5 0 1

verticalFlip#

Flip images vertically.

Parameters:

name required type default minimum maximum
p False float 0.5 0 1