mindspore.dataset.vision.CutOut
- class mindspore.dataset.vision.CutOut(length, num_patches=1, is_hwc=True)[source]
Randomly cut (mask) out a given number of square patches from the input image array.
- Parameters
- Raises
TypeError – If length is not of type integer.
TypeError – If is_hwc is not of type bool.
TypeError – If num_patches is not of type integer.
ValueError – If length is less than or equal 0.
ValueError – If num_patches is less than or equal 0.
RuntimeError – If given tensor shape is not <H, W, C>.
- Supported Platforms:
CPU
Examples
>>> transforms_list = [vision.Decode(), vision.CutOut(80, num_patches=10)] >>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list, ... input_columns=["image"])