Shortcuts

mmcv.image.rescale_size

mmcv.image.rescale_size(old_size: tuple, scale: Union[float, int, Tuple[int, int]], return_scale: bool = False)tuple[源代码]

Calculate the new size to be rescaled to.

参数
  • old_size (tuple[int]) – The old size (w, h) of image.

  • scale (float | int | tuple[int]) – The scaling factor or maximum size. If it is a float number or an integer, 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.

返回

The new rescaled image size.

返回类型

tuple[int]