aleju / imgaug

Image augmentation for machine learning experiments.
http://imgaug.readthedocs.io
MIT License
14.35k stars 2.43k forks source link

Probablity value to use in OneOf #118

Open mpsampat opened 6 years ago

mpsampat commented 6 years ago

Hi @aleju , I am using the OneOf option to do Fliplr, Flipud and rotate. My question is in this case since i want one of the augmentations, is it better to put a probability of 1 for Fliplr and Flipud ? so my code looks like this: augmentation = imgaug.augmenters.OneOf([ imgaug.augmenters.Fliplr(1.0), imgaug.augmenters.Affine(rotate=(-10,10)), imgaug.augmenters.Flipud(1.0) ]) Or is this a bad idea and we should use Fliplr(0.5) with the OneOf option. Thanks Mehul

aleju commented 6 years ago

Seems reasonable. But note that your image is only horizontally flipped 1/3 of the time, while often 1/2 is probably more sensible. Also, you get vertical flips 1/3 of the time, which can be a bit too strong or not needed at all (depends on what the model is supposed to be used for). But if you really just want one of the three augmenters each time, then choosing 1.0 as the probability is the correct way of doing it.

M6stafa commented 3 years ago

Hi, I found this title good for my feature request, so I mention it here.

can we have a different probability for selecting augmentations in OneOf? Its use case is for example when you want to select one of the 3 augmentations but with prob = [0.5. 0.25, 0.25] instead of 1/3 for all of them.

g-jindal2001 commented 2 years ago

@M6stafa has any updates been made for this feature?

M6stafa commented 2 years ago

@M6stafa has any updates been made for this feature?

I don't think so. Currently, I'm using albumentations that has this feature too.