mindspore.dataset.vision.RandomSolarize

class mindspore.dataset.vision.RandomSolarize(threshold=(0, 255))[source]

Randomly selects a subrange within the specified threshold range and sets the pixel value within the subrange to (255 - pixel).

Parameters

threshold (tuple, optional) – Range of random solarize threshold. Default: (0, 255). Threshold values should always be in (min, max) format, where min and max are integers in the range [0, 255], and min <= max. If min=max, then invert all pixel values above min(max).

Raises
  • TypeError – If threshold is not of type tuple.

  • ValueError – If threshold is not in range of [0, 255].

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.RandomSolarize(threshold=(10,100))]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])
Tutorial Examples: