mindspore.dataset.vision.c_transforms.HWC2CHW

class mindspore.dataset.vision.c_transforms.HWC2CHW[source]

Transpose the input image; shape (H, W, C) to shape (C, H, W).

Examples

>>> transforms_list = [c_vision.Decode(),
...                    c_vision.RandomHorizontalFlip(0.75),
...                    c_vision.RandomCrop(512),
...                    c_vision.HWC2CHW()]
>>> image_folder_dataset = image_folder_dataset.map(operations=transforms_list,
...                                                 input_columns=["image"])