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

[RFC] Add support for joint transformations in VisionDataset #872

Merged
merged 2 commits into from
Apr 26, 2019

Conversation

fmassa
Copy link
Member

@fmassa fmassa commented Apr 25, 2019

This is a WIP PR that adds support for jointly transforming both the input and the target.

This has been requested a lot, specially for tasks such as semantic segmentation and object detection.

This is a first draft, which implements the approach that has been proposed in #230

Thanks to the VisionDataset from @pmeier , handling backwards-compatibility will be fairly straightforward without having to write a lot of code.

Feedback is welcome. I'll start with a few datasets which are generally used for detection / segmentation, and we will iterate on the design.

fmassa added 2 commits April 25, 2019 05:59
Breaking change in SBD, the xy_transform has been renamed transforms. I think this is fine given that we have not released a version of torchvision that contains it
@codecov-io
Copy link

codecov-io commented Apr 25, 2019

Codecov Report

Merging #872 into master will increase coverage by 0.38%.
The diff coverage is 26.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #872      +/-   ##
==========================================
+ Coverage    54.4%   54.79%   +0.38%     
==========================================
  Files          36       36              
  Lines        3327     3338      +11     
  Branches      549      550       +1     
==========================================
+ Hits         1810     1829      +19     
+ Misses       1380     1373       -7     
+ Partials      137      136       -1
Impacted Files Coverage Δ
torchvision/datasets/voc.py 22.1% <0%> (+1.71%) ⬆️
torchvision/datasets/sbd.py 31.25% <0%> (+0.48%) ⬆️
torchvision/datasets/coco.py 29.26% <25%> (+4.77%) ⬆️
torchvision/datasets/vision.py 40.35% <34.37%> (-2.99%) ⬇️
torchvision/datasets/imagenet.py 21.55% <0%> (ø) ⬆️
torchvision/transforms/transforms.py 83.37% <0%> (+0.68%) ⬆️
torchvision/transforms/functional.py 70.47% <0%> (+1.26%) ⬆️
torchvision/datasets/utils.py 36.84% <0%> (+1.73%) ⬆️

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 90091b5...f0fde4c. Read the comment docs.

@fmassa
Copy link
Member Author

fmassa commented Apr 26, 2019

@vfdev-5 FYI I've renamed xy_transform to transforms to make it consistent with the other transforms. Given that this was added after the 0.2.2 release, I think it's fine to break backwards-compatibility.

@fmassa fmassa merged commit 0c36735 into pytorch:master Apr 26, 2019
@fmassa fmassa deleted the joint-transforms branch April 26, 2019 12:10
@pmeier pmeier mentioned this pull request May 11, 2019
@pmeier pmeier mentioned this pull request Jul 16, 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.

2 participants