mmcv.image.rescale_size¶
- mmcv.image.rescale_size(old_size: tuple, scale: Union[float, int, tuple], return_scale: bool = False) → tuple[source]¶
Calculate the new size to be rescaled to.
- Parameters
scale (float | tuple[int]) – The scaling factor or maximum size. If it is a float number, then the image will be rescaled by this factor, else if it is a tuple of 2 integers, then the image will be rescaled as large as possible within the scale.
return_scale (bool) – Whether to return the scaling factor besides the rescaled image size.
- Returns
The new rescaled image size.
- Return type