Skip to content

[RFC] Add some utility functions to Cityscapes #1025

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 1 commit into from

Conversation

TheCodez
Copy link
Contributor

This adds some utility functions to the Cityscapes dataset. Those are functions I use all the time when training FCNs on Cityscapes so it might be useful to have them here directly.

@codecov-io
Copy link

codecov-io commented Jun 14, 2019

Codecov Report

Merging #1025 into master will decrease coverage by 0.24%.
The diff coverage is 26.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1025      +/-   ##
==========================================
- Coverage   63.29%   63.04%   -0.25%     
==========================================
  Files          65       65              
  Lines        5152     5185      +33     
  Branches      772      782      +10     
==========================================
+ Hits         3261     3269       +8     
- Misses       1667     1692      +25     
  Partials      224      224
Impacted Files Coverage Δ
torchvision/datasets/cityscapes.py 20.95% <26.47%> (+1.5%) ⬆️

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 2694a5d...39a7a2f. Read the comment docs.

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.

Sure, why not!

But having custom methods to individual classes is a bit annoying in the following sense:

  • derived datasets (like ConcatDataset or Subset) do not carry those methods
  • not all datasets have these methods, so it requires digging into each individual dataset to discover those attributes.

I do think that we should probably add some more methods to the datasets (like class_names etc), but those depend on the type of the dataset itself.

For example, if we define a ClassificationDataset, where it's clear that it always returns an image and a class label, we can add some more structure to it.

I'm not 100% clear on what the scope of those datasets would be (would Cityscapes be a detection dataset? a segmentation dataset? I don't yet know), but I think adding arbitrary methods to each dataset individually now might imply that in the future we will end up deprecating them.

Thoughts?

@TheCodez
Copy link
Contributor Author

@fmassa Cityscapes would be a segmentation dataset in like 99% of the use cases.

adding arbitrary methods to each dataset individually now might imply that in the future we will end up deprecating them.

That's a really good point. We shouldn't end up adding all sorts of methods to the classes just to end up deprecating them later.

So closing this for now.

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.

3 participants