mindspore.dataset.vision.c_transforms.RandomColor
- class mindspore.dataset.vision.c_transforms.RandomColor(degrees=(0.1, 1.9))[source]
Adjust the color of the input image by a fixed or random degree. This operation works only with 3-channel color images.
- Parameters
degrees (sequence, optional) – Range of random color 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 of type sequence of float.
ValueError – If degrees is negative.
RuntimeError – If given tensor shape is not <H, W, C>.
- Supported Platforms:
CPU
Examples
>>> transforms_list = [c_vision.Decode(), c_vision.RandomColor((0.5, 2.0))] >>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list, ... input_columns=["image"])