-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Added MixUp augmentation #1409
Added MixUp augmentation #1409
Conversation
Mixup gives consistent boosts on image classification when using the loss presented in the paper. It also helps on COCO for object detection in the case of large models that tend to overfit. For smaller models this augmentation tends to be detrimental and should be avoided. |
@mikel-brostrom I advise making the |
Albumentation has a mapping list from the argument key to the associated functions in the
The functions specified in the You have added new entries into the
This means apply_image will be called twice; the first is for the "image", and the second is for the "image1". What will happen if you remove the "additional_targets"? |
Thanks @i-aki-y! That simple change solved it! Updated the usage example |
I consider this ready for review. Don't want to steal the spotlight here @i-aki-y but should I put a PR up for Mosaic as well? I implemented it using the same approach as in this. Will you update yours? 😄 |
I think you need to consider the case when the input is grayscale
Sure, you can make your PR. |
Yup, I agree here |
Yes, I read you comment in your MR that is why I though I could upload mine. But is a multi image compose really needed? You can simply have a single target image and several other as input to complete the mosaic right? What could we gain by a multi-image Compose @i-aki-y ? |
@mikel-brostrom My mosaic augmentation's PR have some difficulties, and these are two of them:
But it is difficult because the
There still exist other minor problems. Anyway, I think I need to extend the |
I see, yes, makes sense to have
I can try it out when it is done 😄 |
Did you manage to work this PR out with https://github.com/albumentations-team/albumentations/pull/1420 implementation? Any plans to merge this? |
I will pick this up again if the |
Cool PR, thank you! i am using it with |
Added in #1549 |
In this PR, I implemented MixUp (https://arxiv.org/pdf/1710.09412v2.pdf)
I appreciate any comment and suggetsion.
Usage:
Input images:
Results:
Notes
Notice the images have to be of the same size for this augmentation to work. That is the reason for having the helper augmentation pipeline with
LongestMaxSize
andPadIfNeeded
. MixUp works fine together with mosaic The image size is asserted within the MixUp augmentation and raise aTypeError
exception if the images aren't of the same size