mindspore.dataset.vision.HsvToRgb

View Source On Gitee
class mindspore.dataset.vision.HsvToRgb(is_hwc=False)[source]

Convert the input numpy.ndarray images from HSV to RGB.

Parameters

is_hwc (bool) – If True, means the input image is in shape of <H, W, C> or <N, H, W, C>. Otherwise, it is in shape of <C, H, W> or <N, C, H, W>. Default: False.

Raises

TypeError – If is_hwc is not of type bool.

Supported Platforms:

CPU

Examples

>>> import mindspore.dataset as ds
>>> import mindspore.dataset.vision as vision
>>> from mindspore.dataset.transforms import Compose
>>>
>>> transforms_list = Compose([vision.Decode(to_pil=True),
...                            vision.CenterCrop(20),
...                            vision.ToTensor(),
...                            vision.HsvToRgb()])
>>> # apply the transform to dataset through map function
>>> image_folder_dataset = ds.ImageFolderDataset("/path/to/image_folder_dataset_directory")
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns="image")
Tutorial Examples: