mindspore.dataset.vision.c_transforms.CutOut

class mindspore.dataset.vision.c_transforms.CutOut(length, num_patches=1)[source]

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

Parameters
  • length (int) – The side length of each square patch.

  • num_patches (int, optional) – Number of patches to be cut out of an image (default=1).

Examples

>>> import mindspore.dataset.vision.c_transforms as c_vision
>>>
>>> transforms_list = [c_vision.Decode(), c_vision.CutOut(80, num_patches=10)]
>>> data1 = data1.map(operations=transforms_list, input_columns=["image"])