mindspore.dataset.vision

This module is to support vision augmentations. It includes two parts: c_transforms and py_transforms. C_transforms is a high performance image augmentation module which is developed with c++ opencv. Py_transforms provide more kinds of image augmentations which is developed with Python PIL.

mindspore.dataset.vision.c_transforms

mindspore.dataset.vision.c_transforms.AutoContrast

Apply automatic contrast on input image.

mindspore.dataset.vision.c_transforms.BoundingBoxAugment

Apply a given image transform on a random selection of bounding box regions of a given image.

mindspore.dataset.vision.c_transforms.CenterCrop

Crops the input image at the center to the given size.

mindspore.dataset.vision.c_transforms.CutMixBatch

Apply CutMix transformation on input batch of images and labels.

mindspore.dataset.vision.c_transforms.CutOut

Randomly cut (mask) out a given number of square patches from the input NumPy image array.

mindspore.dataset.vision.c_transforms.Decode

Decode the input image in RGB mode.

mindspore.dataset.vision.c_transforms.Equalize

Apply histogram equalization on input image.

mindspore.dataset.vision.c_transforms.HWC2CHW

Transpose the input image; shape (H, W, C) to shape (C, H, W).

mindspore.dataset.vision.c_transforms.Invert

Apply invert on input image in RGB mode.

mindspore.dataset.vision.c_transforms.MixUpBatch

Apply MixUp transformation on input batch of images and labels.

mindspore.dataset.vision.c_transforms.Normalize

Normalize the input image with respect to mean and standard deviation.

mindspore.dataset.vision.c_transforms.Pad

Pads the image according to padding parameters.

mindspore.dataset.vision.c_transforms.RandomAffine

Apply Random affine transformation to the input image.

mindspore.dataset.vision.c_transforms.RandomColor

Adjust the color of the input image by a fixed or random degree.

mindspore.dataset.vision.c_transforms.RandomColorAdjust

Randomly adjust the brightness, contrast, saturation, and hue of the input image.

mindspore.dataset.vision.c_transforms.RandomCrop

Crop the input image at a random location.

mindspore.dataset.vision.c_transforms.RandomCropDecodeResize

Equivalent to RandomResizedCrop, but crops before decodes.

mindspore.dataset.vision.c_transforms.RandomCropWithBBox

Crop the input image at a random location and adjust bounding boxes accordingly.

mindspore.dataset.vision.c_transforms.RandomHorizontalFlip

Flip the input image horizontally, randomly with a given probability.

mindspore.dataset.vision.c_transforms.RandomHorizontalFlipWithBBox

Flip the input image horizontally, randomly with a given probability and adjust bounding boxes accordingly.

mindspore.dataset.vision.c_transforms.RandomPosterize

Reduce the number of bits for each color channel.

mindspore.dataset.vision.c_transforms.RandomResize

Tensor operation to resize the input image using a randomly selected interpolation mode.

mindspore.dataset.vision.c_transforms.RandomResizedCrop

Crop the input image to a random size and aspect ratio.

mindspore.dataset.vision.c_transforms.RandomResizedCropWithBBox

Crop the input image to a random size and aspect ratio and adjust bounding boxes accordingly.

mindspore.dataset.vision.c_transforms.RandomResizeWithBBox

Tensor operation to resize the input image using a randomly selected interpolation mode and adjust bounding boxes accordingly.

mindspore.dataset.vision.c_transforms.RandomRotation

Rotate the input image by a random angle.

mindspore.dataset.vision.c_transforms.RandomSelectSubpolicy

Choose a random sub-policy from a list to be applied on the input image.

mindspore.dataset.vision.c_transforms.RandomSharpness

Adjust the sharpness of the input image by a fixed or random degree.

mindspore.dataset.vision.c_transforms.RandomSolarize

Invert all pixel values above a threshold.

mindspore.dataset.vision.c_transforms.RandomVerticalFlip

Flip the input image vertically, randomly with a given probability.

mindspore.dataset.vision.c_transforms.RandomVerticalFlipWithBBox

Flip the input image vertically, randomly with a given probability and adjust bounding boxes accordingly.

mindspore.dataset.vision.c_transforms.Rescale

Tensor operation to rescale the input image.

mindspore.dataset.vision.c_transforms.Resize

Resize the input image to the given size.

mindspore.dataset.vision.c_transforms.ResizeWithBBox

Resize the input image to the given size and adjust bounding boxes accordingly.

mindspore.dataset.vision.c_transforms.SoftDvppDecodeRandomCropResizeJpeg

Tensor operation to decode, random crop and resize JPEG image using the simulation algorithm of Ascend series chip DVPP module.

mindspore.dataset.vision.c_transforms.SoftDvppDecodeResizeJpeg

Tensor operation to decode and resize JPEG image using the simulation algorithm of Ascend series chip DVPP module.

mindspore.dataset.vision.c_transforms.UniformAugment

Tensor operation to perform randomly selected augmentation.

mindspore.dataset.vision.py_transforms

mindspore.dataset.vision.py_transforms.AutoContrast

Automatically maximize the contrast of the input PIL image.

mindspore.dataset.vision.py_transforms.CenterCrop

Crop the central reigion of the input PIL image to the given size.

mindspore.dataset.vision.py_transforms.Cutout

Randomly cut (mask) out a given number of square patches from the input NumPy image array.

mindspore.dataset.vision.py_transforms.Decode

Decode the input image to PIL image format in RGB mode.

mindspore.dataset.vision.py_transforms.Equalize

Equalize the histogram of input PIL image.

mindspore.dataset.vision.py_transforms.FiveCrop

Generate 5 cropped images (one central image and four corners images).

mindspore.dataset.vision.py_transforms.Grayscale

Convert the input PIL image to grayscale image.

mindspore.dataset.vision.py_transforms.HsvToRgb

Convert a NumPy HSV image or one batch NumPy HSV images to RGB images.

mindspore.dataset.vision.py_transforms.HWC2CHW

Transpose a NumPy image array; shape (H, W, C) to shape (C, H, W).

mindspore.dataset.vision.py_transforms.Invert

Invert colors of input PIL image.

mindspore.dataset.vision.py_transforms.LinearTransformation

Apply linear transformation to the input NumPy image array, given a square transformation matrix and a mean vector.

mindspore.dataset.vision.py_transforms.MixUp

Apply mix up transformation to the input image and label.

mindspore.dataset.vision.py_transforms.Normalize

Normalize the input NumPy image array of shape (C, H, W) with the given mean and standard deviation.

mindspore.dataset.vision.py_transforms.Pad

Pad the input PIL image according to padding parameters.

mindspore.dataset.vision.py_transforms.RandomAffine

Apply Random affine transformation to the input PIL image.

mindspore.dataset.vision.py_transforms.RandomColor

Adjust the color of the input PIL image by a random degree.

mindspore.dataset.vision.py_transforms.RandomColorAdjust

Perform a random brightness, contrast, saturation, and hue adjustment on the input PIL image.

mindspore.dataset.vision.py_transforms.RandomCrop

Crop the input PIL image at a random location.

mindspore.dataset.vision.py_transforms.RandomErasing

Erase the pixels, within a selected rectangle region, to the given value.

mindspore.dataset.vision.py_transforms.RandomGrayscale

Randomly convert the input image into grayscale image with a given probability.

mindspore.dataset.vision.py_transforms.RandomHorizontalFlip

Randomly flip the input image horizontally with a given probability.

mindspore.dataset.vision.py_transforms.RandomPerspective

Randomly apply perspective transformation to the input PIL image with a given probability.

mindspore.dataset.vision.py_transforms.RandomResizedCrop

Extract crop from the input image and resize it to a random size and aspect ratio.

mindspore.dataset.vision.py_transforms.RandomRotation

Rotate the input PIL image by a random angle.

mindspore.dataset.vision.py_transforms.RandomSharpness

Adjust the sharpness of the input PIL image by a random degree.

mindspore.dataset.vision.py_transforms.RandomVerticalFlip

Randomly flip the input image vertically with a given probability.

mindspore.dataset.vision.py_transforms.Resize

Resize the input PIL image to the given size.

mindspore.dataset.vision.py_transforms.RgbToHsv

Convert a NumPy RGB image or a batch of NumPy RGB images to HSV images.

mindspore.dataset.vision.py_transforms.TenCrop

Generate 10 cropped images (first 5 images from FiveCrop, second 5 images from their flipped version as per input flag to flip vertically or horizontally).

mindspore.dataset.vision.py_transforms.ToPIL

Convert the input decoded NumPy image array of RGB mode to a PIL image of RGB mode.

mindspore.dataset.vision.py_transforms.ToTensor

Convert the input NumPy image array or PIL image of shape (H, W, C) to a NumPy ndarray of shape (C, H, W).

mindspore.dataset.vision.py_transforms.ToType

Convert the input NumPy image array to desired NumPy dtype.

mindspore.dataset.vision.py_transforms.UniformAugment

Uniformly select and apply a number of transforms sequentially from a list of transforms.