mindspore.dataset.vision.RandomLighting

class mindspore.dataset.vision.RandomLighting(alpha=0.05)[源代码]

Add AlexNet-style PCA-based noise to an image. The eigenvalue and eigenvectors for Alexnet’s PCA noise is calculated from the imagenet dataset.

Parameters

alpha (float, optional) – Intensity of the image, which must be non-negative (default=0.05).

Raises
Supported Platforms:

CPU

Examples

>>> transforms_list = [vision.Decode(), vision.RandomLighting(0.1)]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])
execute_py(img)[源代码]

Execute method.

Parameters

img (PIL Image) – Image to be added AlexNet-style PCA-based noise.

Returns

PIL Image, image with noise added.