Batch Transforms#

In this section are defined the classes and functions to transform a batch of images or videos.

Note

Whilst these augmentations accept batched data, some of them offer a trade-off between randomness and computational cost such as BatchRandomColorJitter.

Note

Some transforms rely on Torchvision functional.

Wrappers#

List of wrappers of the data augmentations.

BatchImageWrapper(transforms[, inplace])

Wrap transforms to handle image data.

BatchVideoWrapper(transforms[, inplace, ...])

Wrap transforms to handle batched video data.

Transforms#

List of the batched data augmentations.

BatchMixUp(alpha[, inplace])

Mix input tensor with linear interpolation drawn according a Beta law.

BatchRandomApply(transforms[, p, inplace])

Apply randomly a list of transformations to a batch of images with a given probability.

BatchRandomColorJitter([brightness, ...])

Randomly change the brightness, contrast, saturation and hue to a batch of images.

BatchRandomGaussianBlur(kernel_size[, ...])

Blurs batch of images with randomly chosen Gaussian blur.

BatchRandomGrayScale([p, inplace])

Convert batch of images to grayscale.

BatchRandomHorizontalFlip([p, inplace])

Horizontally flip the given batch of images randomly with a given probability.

BatchRandomResizedCrop(size[, scale, ratio, ...])

Crop a random portion of a batch of images and resize it to a given size.

BatchRandomSolarize(threshold[, p, inplace, ...])

Solarize the batch of images randomly with a given probability by inverting all pixel values above a threshold.

BatchRandomTransform(p, inplace)

Abstract class to make a base class for all batch random transforms.

BatchVideoResize(size[, interpolation, ...])

Resize the input video to the given size.

Functional#

List of the functions to make the batched data augmentations.

batch_adjust_brightness(imgs, brightness_factor)

Adjust brightness of a batch of images.

batch_adjust_contrast(imgs, contrast_factor)

Adjust contrast of a batch of images.

batch_adjust_hue(imgs, hue_factor[, value_check])

Adjust hue of a batch of images.

batch_adjust_saturation(imgs, saturation_factor)

Adjust color saturation of a batch of images.

batch_gaussian_blur(imgs, kernel_size[, ...])

Performs Gaussian blurring on the batch of images by given kernel.

batch_mixup(tensor_1, tensor_2, lam[, inplace])

Mix two tensors with linear interpolation.