mindspore.dataset.vision.py_transforms.RgbToHsv

class mindspore.dataset.vision.py_transforms.RgbToHsv(is_hwc=False)[source]

Convert one or more numpy.ndarray images from RGB to HSV.

Parameters

is_hwc (bool) – Whether the image is in shape of (H, W, C) or (N, H, W, C), otherwise in shape of (C, H, W) or (N, C, H, W) (default=False).

Examples

>>> from mindspore.dataset.transforms.py_transforms import Compose
>>> transforms_list = Compose([py_vision.Decode(),
...                            py_vision.CenterCrop(20),
...                            py_vision.ToTensor(),
...                            py_vision.RgbToHsv()])
>>> # apply the transform to dataset through map function
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns="image")