mindspore.dataset.vision.c_transforms.HWC2CHW
- class mindspore.dataset.vision.c_transforms.HWC2CHW[source]
Transpose the input image from shape (H, W, C) to shape (C, H, W). The input image should be 3 channels image.
- Raises
RuntimeError – If given tensor shape is not <H, W, C>.
- Supported Platforms:
CPU
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"])