mindspore.dataset.vision.ToNumpy
- class mindspore.dataset.vision.ToNumpy[source]
Convert the PIL input image to numpy.ndarray image.
- Supported Platforms:
CPU
Examples
>>> import mindspore.dataset as ds >>> import mindspore.dataset.vision as vision >>> from mindspore.dataset.transforms import Compose >>> >>> # Use ToNumpy to explicitly select C++ implementation of subsequent op >>> transforms_list = Compose([vision.Decode(True), ... vision.RandomHorizontalFlip(0.5), ... vision.ToNumpy(), ... vision.Resize((100, 120))]) >>> # 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: