Skip to content

Improve transforms #466

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
Oktai15 opened this issue Apr 7, 2018 · 7 comments
Closed

Improve transforms #466

Oktai15 opened this issue Apr 7, 2018 · 7 comments

Comments

@Oktai15
Copy link

Oktai15 commented Apr 7, 2018

Hi there!

At this moment, torchvision is so poor; in particular, transforms. It really restricts our ability for data augmentation. However, people have already done a few nice libraries for it. For instance:
https://github.com/mdbloice/Augmentor (already has compatibility with PyTorch)
https://github.com/aleju/imgaug

What about contact with authors and merged these great jobs to torchvision.transforms?

@fmassa
Copy link
Member

fmassa commented Apr 7, 2018

Hi,

Thanks for the feedback!

I'm in the process of adding new functionality to torchvision, to extend it to work with other data types (like bounding boxes).
I'll have a look at the links you provided.

@Oktai15
Copy link
Author

Oktai15 commented Apr 7, 2018

@fmassa, okay, thanks, it will cool :) Actually, I strongly recommend to look at this libraries instead of write new code, but, of course, you know better :)

By the way, don't forget about segmentation!

@Oktai15 Oktai15 closed this as completed Apr 7, 2018
@fmassa
Copy link
Member

fmassa commented Apr 7, 2018

Don't worry, I won't forget about instance segmentation :-)

@Oktai15
Copy link
Author

Oktai15 commented Apr 7, 2018

@fmassa sorry for offtop: I would like to notice that first provided library uses excellent way to transform two or more images. All transforms take list of images rather than just one image like transform in torchvision. For example:

def perform_operation(self, images):
#init random values
for image in images:
    augmented_images.append(do(image))
return augmented_images

I suppose it's great idea ^^

@fmassa
Copy link
Member

fmassa commented Apr 7, 2018

It's indeed much simpler in some cases, but also more restrictive in more general setups.

For the record, this is something that has been bugging me for a long time, see #9 and #230 for some context.

In many cases, you don't want to pass all transforms to all data (no color augmentation for segmentation masks for example), and the approach you mentioned doesn't easily allows that (without making the API overly complex).

@nnop
Copy link

nnop commented Jul 4, 2019

The codes of imaug is somehow far more complicated.

@fmassa
Copy link
Member

fmassa commented Jul 4, 2019

@nnop yes, I saw imaug and agree that it is very complex. I would rather have a simpler API, even if it requires having to write a bit more code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants