mindspore.dataset.vision.get_image_size

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

Get the size of input image as [height, width].

Parameters

image (Union[numpy.ndarray, PIL.Image.Image]) – The image to get size.

Returns

list[int, int], the image size.

Raises
  • RuntimeError – If image has invalid dimensions which should be larger than 1.

  • TypeError – If image is not of type <class ‘numpy.ndarray’> or <class ‘PIL.Image.Image’>.

Examples

>>> image_size = vision.get_image_size(image)