Resize — Torchvision 0.22 documentation (original) (raw)

class torchvision.transforms.Resize(size, interpolation=InterpolationMode.BILINEAR, max_size=None, antialias=True)[source]

Resize the input image to the given size. If the image is torch Tensor, it is expected to have […, H, W] shape, where … means a maximum of two leading dimensions

Parameters:

Examples using Resize:

forward(img)[source]

Parameters:

img (PIL Image or Tensor) – Image to be scaled.

Returns:

Rescaled image.

Return type:

PIL Image or Tensor