-
Notifications
You must be signed in to change notification settings - Fork 196
Add torchvision.transforms.Resize interpolation and antialias. #1441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add torchvision.transforms.Resize interpolation and antialias. #1441
Conversation
@dotnet-policy-service agree company="HACARUS" |
Hey @hiyuh, can you rebase and update releasenotes? |
edfd4f5
to
f6d6213
Compare
@alinpahontu2912 |
I added a few more comments. @hiyuh I have some concerns regarding the compatibility between the current TorchSharp's TorchVision and your changes. Could you specify in which version of TorchVision the antialias parameter was introduced, and whether it is compatible with the current TorchSharp's native dependencies? |
@hiyuh ; if you can give us permission for your branch as following setting, we can also resolve some NOTE: We're planning a solution for the releasenotes conflicts. |
|
|
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
91212e7
to
5d0ab74
Compare
|
@hiyuh , thanks for addressing the all comments. Great contribution! Currently, I'm observing some build errors but I'm not sure if it is relevant to your PR or there is another error. I'm investigating the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Note for future: We can improve the tests if they fail due to float precision but for now they are working fine.
torchvision.transforms.Resize
forced nearestinterpolation
and noantialias
, 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 noantialias
by default fortorchvision.transforms.Resize
to maximize compatibility for existing code using TorchSharp and results in incompatible to originaltorchvision.transforms.Resize
default, however, it would be up to the upstream decision.See also;