Skip to content
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

Expose VisionDataSet class so it can be modified #876

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

bbowles-personal
Copy link
Contributor

This is really helpful class, but I had a use case where I needed to modify slightly.

@codecov-io
Copy link

codecov-io commented Apr 27, 2019

Codecov Report

Merging #876 into master will increase coverage by 0.22%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #876      +/-   ##
==========================================
+ Coverage   55.17%   55.39%   +0.22%     
==========================================
  Files          36       36              
  Lines        3375     3376       +1     
  Branches      553      553              
==========================================
+ Hits         1862     1870       +8     
+ Misses       1375     1370       -5     
+ Partials      138      136       -2
Impacted Files Coverage Δ
torchvision/datasets/__init__.py 100% <100%> (ø) ⬆️
torchvision/transforms/transforms.py 82.54% <0%> (+0.64%) ⬆️
torchvision/transforms/functional.py 71.12% <0%> (+1.21%) ⬆️

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 0c36735...2b0e86b. Read the comment docs.

@pmeier
Copy link
Collaborator

pmeier commented Apr 28, 2019

@bbowles-personal I'm curious: What did you need to modify? Is this something we could also use? On what part was VisionDataset not general enough?

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

LGTM, just curious about what you needed to modify

@@ -17,6 +17,7 @@
from .caltech import Caltech101, Caltech256
from .celeba import CelebA
from .sbd import SBDataset
from .vision import VisionDataset

__all__ = ('LSUN', 'LSUNClass',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't VisionDataset contained in __all__ if we want to expose it?

Copy link
Member

Choose a reason for hiding this comment

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

If we want it to be imported via from torchvision.datasets import *, then yes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let me rephrase: Do we want that? An all or nothing approach seems reasonable to me.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with either, but for consistency let's add it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my case, I wanted to restrict the folders that are found by mucking with _find_classes but the easiest way to do that was just to inherit from VisionDataset and write my own DatasetFolder class.
If you want, I can write a pull to allow a keyword arg to ImageFolder to only allow it to find certain folders, which is actually what I need....
not really using this code for what it was intended to do so not sure if you really want that.
thanks for approving

Copy link
Member

Choose a reason for hiding this comment

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

I can merge this as is, but I'd accept a PR adding VisionDataset to __all__

@fmassa fmassa merged commit 3afcf3c into pytorch:master Apr 29, 2019
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

Successfully merging this pull request may close these issues.

4 participants