Skip to content

feats: add loader in classification task datasets. #8939

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

Merged
merged 6 commits into from
Feb 28, 2025

Conversation

GdoongMathew
Copy link
Contributor

@GdoongMathew GdoongMathew commented Feb 25, 2025

Related to #8922 & #8762

  1. Add loader argument in classification datasets.
  2. Update the transform part of the docstring, to notify users that the transform image may in PIL.Image type or torch.Tensor type, based on the provided loader.
  3. Enable SUPPORT_TV_IMAGE_DECODE unittests.

Copy link

pytorch-bot bot commented Feb 25, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8939

Note: Links to docs will display an error until the docs builds have been completed.

❌ 6 New Failures, 1 Unrelated Failure

As of commit d1be85b with merge base 86f8eb0 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@NicolasHug
Copy link
Member

Thanks a lot for the PR @GdoongMathew . There just seem tob e some minor type annotations issues,, I think we just need to add pathlib.Path as an accepted input type. Do you mind taking a look? Otherwise this looks great!

  torchvision/datasets/sun397.py:65: error: Argument 1 has incompatible type
  "Path"; expected "str"  [arg-type]
              image = self.loader(image_file)
                                  ^~~~~~~~~~
  torchvision/datasets/food101.py:79: error: Argument 1 has incompatible type
  "Path"; expected "str"  [arg-type]
              image = self.loader(image_file)
                                  ^~~~~~~~~~
  torchvision/datasets/flowers102.py:87: error: Argument 1 has incompatible type
  "Path"; expected "str"  [arg-type]
              image = self.loader(image_file)
                                  ^~~~~~~~~~
  torchvision/datasets/dtd.py:86: error: Argument 1 has incompatible type "Path";
  expected "str"  [arg-type]
              image = self.loader(image_file)
                                  ^~~~~~~~~~
  torchvision/datasets/clevr.py:73: error: Argument 1 has incompatible type
  "Path"; expected "str"  [arg-type]
              image = self.loader(image_file)
                                  ^~~~~~~~~~
  Found 5 errors in 5 files (checked 235 source files)

@GdoongMathew
Copy link
Contributor Author

Hi @NicolasHug, I've updated the type annotation.
Thanks~

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @GdoongMathew !

@NicolasHug NicolasHug merged commit 05decc3 into pytorch:main Feb 28, 2025
1 check passed
@GdoongMathew GdoongMathew deleted the feat/loader_api branch February 28, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants