You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add torchvision.transforms.Resize interpolation and antialias. (#1441)
* Add torchvision.transforms.Resize interpolation and antialias.
torchvision.transforms.Resize forced nearest interpolation and no antialias,
but shouln't.
Based on my understanding, original torchvision.transforms.Resize calls like;
- torchvision.transforms.Resize
- torchvision.transforms.functional.resize
- torchvision.transforms._functional_pil.resize
- PIL.Image.Image.resize
- torchvision.transforms._functional_tensor.resize
- torch.nn.functional.interpolate
Note, this PR still keeps nearest interpolation and no antialias by default
for torchvision.transforms.Resize to maximize compatibility for existing
code using TorchSharp and make it being incompatible to original
torchvision.transforms.Resize default, however, it would be up to
the upstream decision.
See also;
* https://pytorch.org/vision/main/generated/torchvision.transforms.Resize.html
* https://pytorch.org/vision/main/generated/torchvision.transforms.functional.resize.html
* https://pytorch.org/docs/stable/generated/torch.nn.functional.interpolate.html
* Update RELEASENOTES.md.
* Consider maxSize compatibility.
* Update antialias documentation.
* Add more compatibility handling.
* Add test cases for antialias.
---------
Co-authored-by: Masaru Kimura <[email protected]>
/// <param name="scale_factor">Multiplier for spatial size. Has to match input size if it is a tuple.</param>
197
-
/// <param name="mode">The algorithm used for upsampling: 'nearest' | 'linear' | 'bilinear' | 'bicubic' | 'trilinear' | 'area'</param>
198
+
/// <param name="mode">The algorithm used for upsampling: 'nearest' | 'linear' | 'bilinear' | 'bicubic' | 'trilinear' | 'area' | 'nearest-exact'</param>
198
199
/// <param name="align_corners">Geometrically, we consider the pixels of the input and output as squares rather than points.
199
200
/// If set to true, the input and output tensors are aligned by the center points of their corner pixels, preserving the values at the corner pixels.
200
201
/// If set to false, the input and output tensors are aligned by the corner points of their corner pixels, and the interpolation uses edge value padding for out-of-boundary values, making this operation independent of input size when scale_factor is kept the same.</param>
0 commit comments