(im_height, im_width, short_size, max_size)
return resized_height, resized_width
get height and width by short size

           Args:
               im_height(int): height of original image, e.g. 800
               im_width(int): width of original image, e.g. 1000
               short_size(int): short size of transformed image. e.g. 800
               max_size(int): max size of transformed image. e.g. 1333

           Returns:
               resized_height(int): height of transformed image
               resized_width(int): width of transformed image
get height and width by short size
get height and width by short size
def get_hw_by_short_size(im_height, im_width, short_size, max_size):
        """get height and width by short size

           Args:
               im_height(int): height of original image, e.g. 800
               im_width(int): width of original image, e.g. 1000
               short_size(int): short size of transformed image. e.g. 800
               max_size(int): max size of transformed image. e.g. 1333

           Returns:
               resized_height(int): height of transformed image
               resized_width(int): width of transformed image
        """

        im_size_min = np.min([im_height, im_width])
        im_size_max = np.max([im_height, im_width])
        scale = (short_size + 0.0) / im_size_min
        if scale * im_size_max > max_size:
            scale = (max_size + 0.0) / im_size_max

        resized_height, resized_width = (
            int(round(im_height * scale)),
            int(round(im_width * scale)),
        )
        return resized_height, resized_width
def get_hw_by_short_size ( im_height , im_width , short_size , max_size ) : im_size_min = np . min ( [ im_height , im_width ] ) im_size_max = np . max ( [ im_height , im_width ] ) scale = ( short_size + 0.0 ) / im_size_min if scale * im_size_max > max_size : scale = ( max_size + 0.0 ) / im_size_max resized_height , resized_width = ( int ( round ( im_height * scale ) ) , int ( round ( im_width * scale ) ) , ) return resized_height , resized_width