Skip to content

[Feature Request] Pass multiple images to randomCrop, randomFlip, etc. #533

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
skief opened this issue Jun 20, 2018 · 9 comments
Closed

Comments

@skief
Copy link

skief commented Jun 20, 2018

Recently I've worked with some semantic segmentation algorithms and there I've needed to randomly crop the images and apply the same crop to the mask/label image(to make sure that they are still aligned) and I couldn't do this with the current torchvision transformations.
Therefore I wanted to ask if anybody else would be interested in an implementation of these transforms for multiple images. If you are interested in a feature like this I could implement this :)

@Naman-ntc
Copy link

Why don't you just use functional transforms? In my opinion it gives you better control as well for augmenting targets instead of passing to transforms.

@Randl
Copy link

Randl commented Aug 5, 2018

I believe joint transformation of input and target is pretty common, and thus probably worth inclusion in vision

@fmassa
Copy link
Member

fmassa commented Aug 13, 2018

Indeed, they are very common and would deserve a place here.

Unfortunately, all the alternatives I've seem / came up with were not generic nor good enough to so that I could add it to torchvision.

In the end, it just seemed easier to have the transforms be written by the user, leveraging the functional interface. That's the most generic way, even though it is a bit more verbose.

@sotte
Copy link
Contributor

sotte commented Sep 9, 2018

This feature request keeps popping up. I think we should improve the docs and the tutorial (especially the data loader tutorial) to cover this case better.

@fmassa
Copy link
Member

fmassa commented Sep 11, 2018

@sotte that's a great point! Would you be willing to improve the documentation?
Maybe not in the beginner's tutorial, but maybe in an intermediate tutorial?

@sotte
Copy link
Contributor

sotte commented Sep 11, 2018

@fmassa sure, I'll try to do it on the weekend.

Maybe I would add a few words to the api docs of functional transforms along the lines "functional transforms give you fine grained control...yada yada") plus a short tutorial for for functional transforms. Sounds good?

@fmassa
Copy link
Member

fmassa commented Sep 11, 2018

@sotte yes, please!

@sotte
Copy link
Contributor

sotte commented Sep 14, 2018

I think (and I'm clearly biased) that the ddb145b / #602 improved the multiple images transformation situation. Maybe we don't need the tutorial.

@skief you asked the initial question. What do you think? Is the improvement good enough or is a tutorial still needed?

@fmassa
Copy link
Member

fmassa commented Sep 17, 2018

I think the current situation is better now than what it was before, thanks to the note from @sotte
As I mentioned before, I think it's best for more complex cases to be handled using the functional interface, so I'm closing this issue now. But please fell free to comment if you disagree.

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

No branches or pull requests

5 participants