mindspore.dataset.vision.get_image_num_channels

mindspore.dataset.vision.get_image_num_channels(image)[source]

Get the number of input image channels.

Parameters

image (Union[numpy.ndarray, PIL.Image.Image]) – Image to get the number of channels.

Returns

int, the number of input image channels.

Examples

>>> num_channels = vision.get_image_num_channels(image)