def resize_short(src, size, interp=2):
    'Resizes shorter edge to size.\n\n    Note: `resize_short` uses OpenCV (not the CV2 Python library).\n    MXNet must have been built with OpenCV for `resize_short` to work.\n\n    Resizes the original image by setting the shorter edge to size\n    and setting the longer edge accordingly.\n    Resizing function is called from OpenCV.\n\n    Parameters\n    ----------\n    src : NDArray\n        The original image.\n    size : int\n        The length to be set for the shorter edge.\n    interp : int, optional, default=2\n        Interpolation method used for resizing the image.\n        Possible values:\n        0: Nearest Neighbors Interpolation.\n        1: Bilinear interpolation.\n        2: Area-based (resampling using pixel area relation). It may be a\n        preferred method for image decimation, as it gives moire-free\n        results. But when the image is zoomed, it is similar to the Nearest\n        Neighbors method. (used by default).\n        3: Bicubic interpolation over 4x4 pixel neighborhood.\n        4: Lanczos interpolation over 8x8 pixel neighborhood.\n        9: Cubic for enlarge, area for shrink, bilinear for others\n        10: Random select from interpolation method metioned above.\n        Note:\n        When shrinking an image, it will generally look best with AREA-based\n        interpolation, whereas, when enlarging an image, it will generally look best\n        with Bicubic (slow) or Bilinear (faster but still looks OK).\n        More details can be found in the documentation of OpenCV, please refer to\n        http://docs.opencv.org/master/da/d54/group__imgproc__transform.html.\n\n    Returns\n    -------\n    NDArray\n        An \'NDArray\' containing the resized image.\n\n    Example\n    -------\n    >>> with open("flower.jpeg", \'rb\') as fp:\n    ...     str_image = fp.read()\n    ...\n    >>> image = mx.img.imdecode(str_image)\n    >>> image\n    <NDArray 2321x3482x3 @cpu(0)>\n    >>> size = 640\n    >>> new_image = mx.img.resize_short(image, size)\n    >>> new_image\n    <NDArray 2321x3482x3 @cpu(0)>\n    '
    (h, w, _) = src.shape
    if (h > w):
        (new_h, new_w) = (((size * h) // w), size)
    else:
        (new_h, new_w) = (size, ((size * w) // h))
    return imresize(src, new_w, new_h, interp=_get_interp_method(interp, (h, w, new_h, new_w)))
Resizes shorter edge to size.

Note: `resize_short` uses OpenCV (not the CV2 Python library).
MXNet must have been built with OpenCV for `resize_short` to work.

Resizes the original image by setting the shorter edge to size
and setting the longer edge accordingly.
Resizing function is called from OpenCV.

Parameters
----------
src : NDArray
    The original image.
size : int
    The length to be set for the shorter edge.
interp : int, optional, default=2
    Interpolation method used for resizing the image.
    Possible values:
    0: Nearest Neighbors Interpolation.
    1: Bilinear interpolation.
    2: Area-based (resampling using pixel area relation). It may be a
    preferred method for image decimation, as it gives moire-free
    results. But when the image is zoomed, it is similar to the Nearest
    Neighbors method. (used by default).
    3: Bicubic interpolation over 4x4 pixel neighborhood.
    4: Lanczos interpolation over 8x8 pixel neighborhood.
    9: Cubic for enlarge, area for shrink, bilinear for others
    10: Random select from interpolation method metioned above.
    Note:
    When shrinking an image, it will generally look best with AREA-based
    interpolation, whereas, when enlarging an image, it will generally look best
    with Bicubic (slow) or Bilinear (faster but still looks OK).
    More details can be found in the documentation of OpenCV, please refer to
    http://docs.opencv.org/master/da/d54/group__imgproc__transform.html.

Returns
-------
NDArray
    An 'NDArray' containing the resized image.

Example
-------
>>> with open("flower.jpeg", 'rb') as fp:
...     str_image = fp.read()
...
>>> image = mx.img.imdecode(str_image)
>>> image
<NDArray 2321x3482x3 @cpu(0)>
>>> size = 640
>>> new_image = mx.img.resize_short(image, size)
>>> new_image
<NDArray 2321x3482x3 @cpu(0)>
def resize_short(src, size, interp=2):
    'Resizes shorter edge to size.\n\n    Note: `resize_short` uses OpenCV (not the CV2 Python library).\n    MXNet must have been built with OpenCV for `resize_short` to work.\n\n    Resizes the original image by setting the shorter edge to size\n    and setting the longer edge accordingly.\n    Resizing function is called from OpenCV.\n\n    Parameters\n    ----------\n    src : NDArray\n        The original image.\n    size : int\n        The length to be set for the shorter edge.\n    interp : int, optional, default=2\n        Interpolation method used for resizing the image.\n        Possible values:\n        0: Nearest Neighbors Interpolation.\n        1: Bilinear interpolation.\n        2: Area-based (resampling using pixel area relation). It may be a\n        preferred method for image decimation, as it gives moire-free\n        results. But when the image is zoomed, it is similar to the Nearest\n        Neighbors method. (used by default).\n        3: Bicubic interpolation over 4x4 pixel neighborhood.\n        4: Lanczos interpolation over 8x8 pixel neighborhood.\n        9: Cubic for enlarge, area for shrink, bilinear for others\n        10: Random select from interpolation method metioned above.\n        Note:\n        When shrinking an image, it will generally look best with AREA-based\n        interpolation, whereas, when enlarging an image, it will generally look best\n        with Bicubic (slow) or Bilinear (faster but still looks OK).\n        More details can be found in the documentation of OpenCV, please refer to\n        http://docs.opencv.org/master/da/d54/group__imgproc__transform.html.\n\n    Returns\n    -------\n    NDArray\n        An \'NDArray\' containing the resized image.\n\n    Example\n    -------\n    >>> with open("flower.jpeg", \'rb\') as fp:\n    ...     str_image = fp.read()\n    ...\n    >>> image = mx.img.imdecode(str_image)\n    >>> image\n    <NDArray 2321x3482x3 @cpu(0)>\n    >>> size = 640\n    >>> new_image = mx.img.resize_short(image, size)\n    >>> new_image\n    <NDArray 2321x3482x3 @cpu(0)>\n    '
    (h, w, _) = src.shape
    if (h > w):
        (new_h, new_w) = (((size * h) // w), size)
    else:
        (new_h, new_w) = (size, ((size * w) // h))
    return imresize(src, new_w, new_h, interp=_get_interp_method(interp, (h, w, new_h, new_w)))