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 random degree.

Parameters

degrees (Sequence[float, float], optional) – Range of sharpness adjustment degree to select from, arranged in order of (min, max). A degree of 0.0 gives a blurred image, a degree of 1.0 gives the original image and a degree of 2.0 gives a sharpened image. Default: (0.1, 1.9).

Raises
  • TypeError – If degrees is not of type Sequence[float, float].

  • ValueError – If degrees is negative.

  • ValueError – If degrees is not in order of (min, max).

Supported Platforms:

CPU

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")