[Feat] kornia.Resize has a bad default for align_corners
See original GitHub issue🐛 Bug
kornia.Resize
has a bad default for align_corners
if interpolation=="nearest"
or interpolation=="area"
.
To Reproduce
import torch
import kornia
transform = kornia.Resize(32, interpolation="nearest")
input = torch.rand(1, 3, 16, 16)
transform(input)
ValueError: align_corners option can only be set with the interpolating modes: linear | bilinear | bicubic | trilinear
Expected behavior
This should work out of the box. You need to explicitly set align_corners=None
to get this working. This is neither documented nor even accepted by the type annotations.
Environment
kornia==0.4.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
kornia.geometry.transform - Read the Docs
align_corners ( bool , optional) – interpolation flag. Default: True ... kornia.geometry.transform.scale(tensor, scale_factor, center=None, mode='bilinear', ...
Read more >Open Source Differentiable Computer Vision Library for PyTorch
At a granular level, Kornia is a library that consists of the ... The param align_corners has been set by default to None...
Read more >Open Source Differentiable Computer Vision ... - PythonRepo
kornia/kornia/, Kornia is a differentiable computer vision library ... The param align_corners has been set by default to None that maps to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This appears to be fixed in the latest release. The following has no errors:
although the original error can be reproduced with:
Sorry for the delay. I can give it a shot.