Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Add support for (input, target) style datasets (e.g. torchvision) to from_datasets #552

Merged
merged 3 commits into from
Jul 7, 2021

Conversation

ethanwharris
Copy link
Collaborator

@ethanwharris ethanwharris commented Jul 7, 2021

What does this PR do?

Fixes #373

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Neat !

@ethanwharris ethanwharris changed the title Add support for torchvision data sets to from_datasets Add support for (input, target) style datasets (e.g. torchvision) to from_datasets Jul 7, 2021
# check validation data
data = next(iter(img_data.val_dataloader()))
imgs, labels = data[DefaultDataKeys.INPUT], data[DefaultDataKeys.TARGET]
assert imgs.shape == (2, 3, 196, 196)
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason for using 196 as h, w for imagenet? I thought the default was 224.

@codecov
Copy link

codecov bot commented Jul 7, 2021

Codecov Report

Merging #552 (f463cab) into master (5d98cde) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #552   +/-   ##
=======================================
  Coverage   91.30%   91.31%           
=======================================
  Files         112      112           
  Lines        7132     7127    -5     
=======================================
- Hits         6512     6508    -4     
+ Misses        620      619    -1     
Flag Coverage Δ
unittests 91.31% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/core/data/data_source.py 94.31% <100.00%> (+0.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d98cde...f463cab. Read the comment docs.

@ethanwharris ethanwharris merged commit bf5d679 into master Jul 7, 2021
@ethanwharris ethanwharris deleted the feature/torchvision_support branch July 7, 2021 16:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for torchvision datasets in from_* or from_datasets
3 participants