Skip to content

Added CUB200-2010 and 2011 version #279

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

Closed
wants to merge 14 commits into from
Closed

Added CUB200-2010 and 2011 version #279

wants to merge 14 commits into from

Conversation

vishwakftw
Copy link
Contributor

@vishwakftw vishwakftw commented Oct 1, 2017

Following this pull request, I have decided to first add the CUB200-2010 version of the CUB200 dataset. Details can be found here.

Hope this fits in well with the current setup. This code doesn't leverage any existing datasets.

If this works out well, I am also considering adding the CUB200-2011 version of the CUB200 dataset.

@vishwakftw vishwakftw changed the title Added CUB200-2010 version Added CUB200-2010 and 2011 version Oct 2, 2017
@vishwakftw
Copy link
Contributor Author

The next commit will include the CUB200-2011 version of the CUB200 dataset. More information can be found here.

@fmassa
Copy link
Member

fmassa commented Oct 2, 2017

Hi,
Thanks for the PR!

I believe both datasets are the same except for the downloadable files. Could you merge both in a single class and have a year argument in the constructor?

Also, there is a lot of copy-paste in the download function, I think it would be better to clean this up / reuse it from another dataset. Maybe refactor it and add it somewhere where the other datasets that use it can call from?

One last thing, I suppose you put all the images in a single file because the dataset is small and can fit in memory. But are the original images 64x64, or explicitly stated in the documentation of the dataset that we should use this setup? If not, I'd rather avoid doing this resize, and instead load the raw images from disk at every __getitem__.

@vishwakftw
Copy link
Contributor Author

Thanks for the feedback. I have a few queries:

  1. The images in the CUB200 datasets (both years) have variably sized and are generally large. I think it would not work in a general neural network if the images are variably-sized. This is why I resized it to 64x64 and stored it in one file. If you have any suggestions/improvements of this idea, let me know.

  2. The datasets CUB200-2010 and CUB200-2011 have different file arrangements/structures. For example: in CUB200-2011 there is a proper file separating the train and test images, whereas in CUB200-2010 there are separate files indicating train and test images. This is why I thought I would not be able to use pre-written download functions. Any suggestions/improvements are welcome here too.

  3. In your second remark, are you suggesting the inclusion of a utils.py file, wherein the canonical functions are present, such as download, __len__ and __getitem__?

@fmassa
Copy link
Member

fmassa commented Oct 2, 2017

  • If the images have different sizes, I think it's not a good idea to restrict it to be 64x64, as other users might want to use a higher size, or keep the original aspect ratio, etc. I'd suggest not resizing the images, and loading them from disk as is done in ImageFolder, or in the original PR that you referred to
  • I haven't looked in detail, but it should be possible to factor out the differences in a common code, and use the same interface for both datasets once those (small) differences are addressed.
  • I was thinking about having a utils.py file for example, which contains a generic download function that is used by all the other datasets that have a download function. This might require some refactoring, but from a quick view I have the impression that we would have a much cleaner code.

@vishwakftw
Copy link
Contributor Author

@fmassa I have changed a few things after your suggestions. Please let me know what you think.

@vishwakftw
Copy link
Contributor Author

@fmassa My PR helps cover issues like these too w.r.t. documentation. #288

Copy link
Contributor Author

@vishwakftw vishwakftw left a comment

Choose a reason for hiding this comment

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

Resolve possible merge conflicts

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.

Hi,

I did a quick pass, and there seems to be a problem with the current code.
Once you address it, I'll have a more in-depth look.
Thanks!

README.rst Outdated
Contributing
============
We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us.
You can find the API doucmentation on the pytorch website: http://pytorch.org/docs/master/torchvision/

This comment was marked as off-topic.

This comment was marked as off-topic.

Returns:
tuple: (image, target) where target is index of the target class.
"""
path, target = self.data_set[index]

This comment was marked as off-topic.

This comment was marked as off-topic.

@vishwakftw vishwakftw closed this Jan 1, 2018
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.

2 participants