def scale_min(im, targ, interpolation=cv2.INTER_AREA):
r,c,*_ = im.shape<EOL>ratio = targ/min(r,c)<EOL>sz = (scale_to(c, ratio, targ), scale_to(r, ratio, targ))<EOL>return cv2.resize(im, sz, interpolation=interpolation)<EOL>
Scales the image so that the smallest axis is of size targ.

    Arguments:
        im (array): image
        targ (int): target size