mindspore.dataset.vision.py_transforms.RandomSharpness

class mindspore.dataset.vision.py_transforms.RandomSharpness(degrees=(0.1, 1.9))[source]

Adjust the sharpness of the input PIL image by a fixed or random degree. Degree of 0.0 gives a blurred image, degree of 1.0 gives the original image, and degree of 2.0 gives a sharpened image.

Parameters

degrees (sequence) – Range of random sharpness adjustment degrees. It should be in (min, max) format (default=(0.1,1.9)).

Examples

>>> from mindspore.dataset.transforms.py_transforms import Compose
>>> transforms_list = Compose([py_vision.Decode(),
...                            py_vision.RandomSharpness((0.5, 1.5)),
...                            py_vision.ToTensor()])
>>> # apply the transform to dataset through map function
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns="image")