mindspore.dataset.vision.RandomSharpness
- class mindspore.dataset.vision.RandomSharpness(degrees=(0.1, 1.9))[source]
Adjust the sharpness of the input 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 (Union[list, tuple], optional) – Range of random sharpness adjustment degrees, which must be non-negative. It should be in (min, max) format. If min=max, then it is a single fixed magnitude operation. Default:
(0.1, 1.9)
.- Raises
TypeError – If degrees is not a list or a tuple.
ValueError – If degrees is negative.
ValueError – If degrees is in (max, min) format instead of (min, max).
- 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.RandomSharpness(degrees=(0.2, 1.9))] >>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list, ... input_columns=["image"])
- Tutorial Examples: