mindspore.dataset.vision.RandomLighting
- class mindspore.dataset.vision.RandomLighting(alpha=0.05)[source]
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
TypeError – If alpha is not of type float.
ValueError – If alpha is negative.
RuntimeError – If given tensor shape is not <H, W, C>.
- 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.RandomLighting(0.1)] >>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list, ... input_columns=["image"])
- Tutorial Examples: