Table Of Contents
Table Of Contents

scale_down

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.

Parameters:
  • 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.
Returns:

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

Return type:

tuple of int

Example

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