mindspore.dataset.vision.Erase

View Source On Gitee
class mindspore.dataset.vision.Erase(top, left, height, width, value=0, inplace=False)[source]

Erase the input image with given value.

Parameters
  • top (int) – Vertical ordinate of the upper left corner of erased region.

  • left (int) – Horizontal ordinate of the upper left corner of erased region.

  • height (int) – Height of erased region.

  • width (int) – Width of erased region.

  • value (Union[int, Sequence[int, int, int]], optional) – Pixel value used to pad the erased area. Default: 0. If int is provided, it will be used for all RGB channels. If Sequence[int, int, int] is provided, it will be used for R, G, B channels respectively.

  • inplace (bool, optional) – Whether to apply erasing inplace. Default: False.

Raises
Supported Platforms:

CPU

Examples

>>> import mindspore.dataset as ds
>>> import mindspore.dataset.vision as vision
>>>
>>> image_folder_dataset = ds.ImageFolderDataset("/path/to/image_folder_dataset_directory")
>>> transforms_list = [vision.Decode(), vision.Erase(10,10,10,10)]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])
Tutorial Examples: