Skip to content

NEAREST_EXACT and BICUBIC work against the doc of AutoAugment() #9073

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

Open
hyperkai opened this issue May 16, 2025 · 2 comments
Open

NEAREST_EXACT and BICUBIC work against the doc of AutoAugment() #9073

hyperkai opened this issue May 16, 2025 · 2 comments
Assignees

Comments

@hyperkai
Copy link

πŸ› Describe the bug

The doc of AutoAugment() says that only NEAREST and BILINEAR are supported:

Parameters:
...

  • interpolation (InterpolationMode, optional) – ... If input is Tensor, only InterpolationMode.NEAREST, InterpolationMode.BILINEAR are supported.

But NEAREST_EXACT and BICUBIC work against the doc as shown below:

from torchvision.datasets import OxfordIIITPet
from torchvision.transforms.v2 import AutoAugment, PILToTensor

origin_data = OxfordIIITPet(
    root="data"
)

def show_aaimagetensor(im, ip=None):
    aa = AutoAugment(interpolation=ip)
    ptt = PILToTensor()
    print(ptt(aa(im))[0][200])

show_aaimagetensor(im=origin_data[0][0], ip=InterpolationMode.NEAREST_EXACT)
# tensor([ 83,  74,  77,  80,  81,  76,  85,  88, 128, 143,
#         194, 215, 247, 225, 242, 255, 255, 238, 242, 242,
#         242, 247, 255, 238, 247, ..., 255, 255,   0], dtype=torch.uint8)

show_aaimagetensor(im=origin_data[0][0], ip=InterpolationMode.BICUBIC)
# tensor([ 32,  34,  34,  32,  30,  34,  36,  36,  36,  36,
#          36,  37,  28,  30,  30,  30,  34,  30,  30,  32,
#          34,  25,  30,  34,  32, ...,  34,  27,  27], dtype=torch.uint8)

Versions

import torchvision

torchvision.__version__ # '0.20.1'
@AntoineSimoulin
Copy link
Member

Hey @hyperkai, thank you for opening this issue. After reviewing the details, I suggest we consolidate the discussion with #9065, as it appears to be closely related.

@AntoineSimoulin AntoineSimoulin self-assigned this May 21, 2025
@NicolasHug
Copy link
Member

Feel free to submit a PR to clarify the docs @hyperkai .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants