mindspore.dataset.vision.py_transforms.UniformAugment

class mindspore.dataset.vision.py_transforms.UniformAugment(transforms, num_ops=2)[source]

Uniformly select and apply a number of transforms sequentially from a list of transforms. Randomly assign a probability to each transform for each image to decide whether to apply the transform or not.

All the transforms in transform list must have the same input/output data type.

Parameters
  • transforms (list) – List of transformations to be chosen from to apply.

  • num_ops (int, optional) – number of transforms to sequentially apply (default=2).

Examples

>>> import mindspore.dataset.vision.py_transforms as py_vision
>>> from mindspore.dataset.transforms.py_transforms import Compose
>>>
>>> transforms_list = [py_vision.CenterCrop(64),
>>>                    py_vision.RandomColor(),
>>>                    py_vision.RandomSharpness(),
>>>                    py_vision.RandomRotation(30)]
>>> Compose([py_vision.Decode(),
>>>          py_vision.UniformAugment(transforms_list),
>>>          py_vision.ToTensor()])