Table Of Contents
Table Of Contents


mxnet.image.scale_down(src_size, size)[source]

Scales down crop size if it’s larger than image size.

If width/height of the crop is larger than the width/height of the image, sets the width/height to the width/height of the image.

  • src_size (tuple of int) – Size of the image in (width, height) format.

  • size (tuple of int) – Size of the crop in (width, height) format.


A tuple containing the scaled crop size in (width, height) format.

Return type

tuple of int


>>> src_size = (640,480)
>>> size = (720,120)
>>> new_size = mx.img.scale_down(src_size, size)
>>> new_size