diff --git a/torchvision/transforms/functional.py b/torchvision/transforms/functional.py index 09c8bdbcfeb..1676aa2b744 100644 --- a/torchvision/transforms/functional.py +++ b/torchvision/transforms/functional.py @@ -423,13 +423,13 @@ def resize( supported. The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well. max_size (int, optional): The maximum allowed for the longer edge of - the resized image: if the longer edge of the image is greater - than ``max_size`` after being resized according to ``size``, then - the image is resized again so that the longer edge is equal to - ``max_size``. As a result, ``size`` might be overruled, i.e. the - smaller edge may be shorter than ``size``. This is only supported - if ``size`` is an int (or a sequence of length 1 in torchscript - mode). + the resized image. If the longer edge of the image is greater + than ``max_size`` after being resized according to ``size``, + ``size`` will be overruled so that the longer edge is equal to + ``max_size``. + As a result, the smaller edge may be shorter than ``size``. This + is only supported if ``size`` is an int (or a sequence of length + 1 in torchscript mode). antialias (bool, optional): Whether to apply antialiasing. It only affects **tensors** with bilinear or bicubic modes and it is ignored otherwise: on PIL images, antialiasing is always applied on diff --git a/torchvision/transforms/transforms.py b/torchvision/transforms/transforms.py index 46af416e407..1edf772bc8f 100644 --- a/torchvision/transforms/transforms.py +++ b/torchvision/transforms/transforms.py @@ -307,13 +307,13 @@ class Resize(torch.nn.Module): ``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported. The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well. max_size (int, optional): The maximum allowed for the longer edge of - the resized image: if the longer edge of the image is greater - than ``max_size`` after being resized according to ``size``, then - the image is resized again so that the longer edge is equal to - ``max_size``. As a result, ``size`` might be overruled, i.e. the - smaller edge may be shorter than ``size``. This is only supported - if ``size`` is an int (or a sequence of length 1 in torchscript - mode). + the resized image. If the longer edge of the image is greater + than ``max_size`` after being resized according to ``size``, + ``size`` will be overruled so that the longer edge is equal to + ``max_size``. + As a result, the smaller edge may be shorter than ``size``. This + is only supported if ``size`` is an int (or a sequence of length + 1 in torchscript mode). antialias (bool, optional): Whether to apply antialiasing. It only affects **tensors** with bilinear or bicubic modes and it is ignored otherwise: on PIL images, antialiasing is always applied on diff --git a/torchvision/transforms/v2/_geometry.py b/torchvision/transforms/v2/_geometry.py index 59791c30b9d..1a52816394d 100644 --- a/torchvision/transforms/v2/_geometry.py +++ b/torchvision/transforms/v2/_geometry.py @@ -97,13 +97,13 @@ class Resize(Transform): ``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported. The corresponding Pillow integer constants, e.g. ``PIL.Image.BILINEAR`` are accepted as well. max_size (int, optional): The maximum allowed for the longer edge of - the resized image: if the longer edge of the image is greater - than ``max_size`` after being resized according to ``size``, then - the image is resized again so that the longer edge is equal to - ``max_size``. As a result, ``size`` might be overruled, i.e. the - smaller edge may be shorter than ``size``. This is only supported - if ``size`` is an int (or a sequence of length 1 in torchscript - mode). + the resized image. If the longer edge of the image is greater + than ``max_size`` after being resized according to ``size``, + ``size`` will be overruled so that the longer edge is equal to + ``max_size``. + As a result, the smaller edge may be shorter than ``size``. This + is only supported if ``size`` is an int (or a sequence of length + 1 in torchscript mode). antialias (bool, optional): Whether to apply antialiasing. It only affects **tensors** with bilinear or bicubic modes and it is ignored otherwise: on PIL images, antialiasing is always applied on