mindspore.dataset.transforms.py_transforms.RandomOrder
- class mindspore.dataset.transforms.py_transforms.RandomOrder(transforms)[source]
Perform a series of transforms to the input PIL image in a random order.
- Parameters
transforms (list) – List of the transformations to apply.
- Raises
TypeError – If transforms is not of type list.
TypeError – If elements of transforms are neither Python callable objects nor data processing operations in py_transforms.
ValueError – If transforms is empty.
- Supported Platforms:
CPU
Examples
>>> from mindspore.dataset.transforms.py_transforms import Compose >>> transforms_list = [py_vision.RandomHorizontalFlip(0.5), ... py_vision.Normalize((0.491, 0.482, 0.447), (0.247, 0.243, 0.262)), ... py_vision.RandomErasing()] >>> transforms = Compose([py_vision.Decode(), ... py_transforms.RandomOrder(transforms_list), ... py_vision.ToTensor()]) >>> image_folder_dataset = image_folder_dataset.map(operations=transforms, input_columns=["image"])