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 are developed with Python PIL.
Common imported modules in corresponding API examples are as follows:
import mindspore.dataset.vision.c_transforms as c_vision
import mindspore.dataset.vision.py_transforms as py_vision
from mindspore.dataset.transforms import c_transforms
Descriptions of common data processing terms are as follows:
TensorOperation, the base class of all data processing operations implemented in C++.
PyTensorOperation, the base class of all data processing operations implemented in Python.
ImageTensorOperation, the base class of all image processing operations. It is a derived class of TensorOperation.
mindspore.dataset.vision.c_transforms
Apply automatic contrast on input image. |
|
Apply a given image processing operation on a random selection of bounding box regions of a given image. |
|
Crop the input image at the center to the given size. |
|
Change the color space of the image. |
|
Crop the input image at a specific location. |
|
Apply CutMix transformation on input batch of images and labels. |
|
Randomly cut (mask) out a given number of square patches from the input image array. |
|
Decode the input image. |
|
Apply histogram equalization on input image. |
|
Blur input image with the specified Gaussian kernel. |
|
Flip the input image horizontally. |
|
Transpose the input image from shape <H, W, C> to shape <C, H, W>. |
|
Apply invert on input image in RGB mode. |
|
Apply MixUp transformation on input batch of images and labels. |
|
Normalize the input image with respect to mean and standard deviation. |
|
Normalize the input image with respect to mean and standard deviation then pad an extra channel with value zero. |
|
Pad the image. |
|
Apply Random affine transformation to the input image. |
|
Adjust the color of the input image by a fixed or random degree. |
|
Randomly adjust the brightness, contrast, saturation, and hue of the input image. |
|
Crop the input image at a random location. |
|
|
A combination of Crop, Decode and Resize. |
Crop the input image at a random location and adjust bounding boxes accordingly. |
|
Randomly flip the input image horizontally with a given probability. |
|
|
Flip the input image horizontally randomly with a given probability and adjust bounding boxes accordingly. |
Reduce the number of bits for each color channel to posterize the input image randomly with a given probability. |
|
Resize the input image using a randomly selected interpolation mode. |
|
This operator will crop the input image randomly, and resize the cropped image using a selected interpolation mode. |
|
|
Crop the input image to a random size and aspect ratio and adjust bounding boxes accordingly. |
Tensor operation to resize the input image using a randomly selected interpolation mode and adjust bounding boxes accordingly. |
|
Rotate the input image randomly within a specified range of degrees. |
|
Choose a random sub-policy from a policy list to be applied on the input image. |
|
Adjust the sharpness of the input image by a fixed or random degree. |
|
Randomly selects a subrange within the specified threshold range and sets the pixel value within the subrange to (255 - pixel). |
|
Randomly flip the input image vertically with a given probability. |
|
|
Flip the input image vertically, randomly with a given probability and adjust bounding boxes accordingly. |
Rescale the input image with the given rescale and shift. |
|
Resize the input image to the given size with a given interpolation mode. |
|
Resize the input image to the given size and adjust bounding boxes accordingly. |
|
Rotate the input image by specified degrees. |
|
Slice Tensor to multiple patches in horizontal and vertical directions. |
|
|
A combination of Crop, Decode and Resize using the simulation algorithm of Ascend series chip DVPP module. |
|
Decode and resize JPEG image using the simulation algorithm of Ascend series chip DVPP module. |
Perform randomly selected augmentation on input image. |
|
Flip the input image vertically. |
mindspore.dataset.vision.py_transforms
Maximize (normalize) contrast of the input PIL Image. |
|
Crop the central region of the input PIL Image with the given size. |
|
Randomly cut out a certain number of square patches on the input numpy.ndarray image, setting the pixel values in the patch to zero. |
|
Decode the input raw image bytes to PIL Image format in RGB mode. |
|
Equalize the histogram of the input PIL Image. |
|
Crop the given image into one central crop and four corners. |
|
Convert the input PIL Image to grayscale. |
|
Convert the input numpy.ndarray images from HSV to RGB. |
|
Transpose the input numpy.ndarray image of shape (H, W, C) to (C, H, W). |
|
Invert the colors of the input PIL Image. |
|
Linearly transform the input numpy.ndarray image with a square transformation matrix and a mean vector. |
|
Randomly mix up a batch of images together with its labels. |
|
Normalize the input numpy.ndarray image of shape (C, H, W) with the specified mean and standard deviation. |
|
Normalize the input numpy.ndarray image of shape (C, H, W) with the specified mean and standard deviation, then pad an extra channel filled with zeros. |
|
Pad the input PIL Image on all sides. |
|
Apply random affine transformation to the input PIL Image. |
|
Adjust the color balance of the input PIL Image by a random degree. |
|
Randomly adjust the brightness, contrast, saturation, and hue of the input PIL Image. |
|
Crop the input PIL Image at a random location with the specified size. |
|
Randomly erase pixels within a random selected rectangle erea on the input numpy.ndarray image. |
|
Randomly convert the input PIL Image to grayscale. |
|
Randomly flip the input PIL Image horizontally with a given probability. |
|
Randomly apply perspective transformation to the input PIL Image with a given probability. |
|
Randomly crop the input PIL Image and resize it to a given size. |
|
Rotate the input PIL Image by a random angle. |
|
Adjust the sharpness of the input PIL Image by a random degree. |
|
Randomly flip the input PIL Image vertically with a given probability. |
|
Resize the input PIL Image to the given size. |
|
Convert the input numpy.ndarray images from RGB to HSV. |
|
Crop the given image into one central crop and four corners with the flipped version of these. |
|
Convert the input decoded numpy.ndarray image to PIL Image. |
|
Convert the input PIL Image or numpy.ndarray to numpy.ndarray of the desired dtype. |
|
Convert the input numpy.ndarray image to the desired dtype. |
|
Uniformly select a number of transformations from a sequence and apply them sequentially and randomly, which means that there is a chance that a chosen transformation will not be applied. |
mindspore.dataset.vision.utils
Padding Mode, Border Type. |
|
The color conversion mode. |
|
Data Format of images after batch operation. |
|
Interpolation Modes. |
|
Mode to Slice Tensor into multiple parts. |