Open zakajd opened 2 years ago
@Dipet I'd like to work on this one. Any ideas how to better implement switching between different samplings?
Ideally, this option should be available for all transforms out of the box.
Interesting question. We have wrapper functions for numpy random module.
I think we need to create some base class that would represent sampling strategy. When we will create some random sampled value we will wrap this value into this wrapper and on call get_params
we will just call sample
method for this variable.
Something like random logic in imgaug https://github.com/aleju/imgaug/blob/0101108d4fed06bc5056c4a03e2bcb0216dac326/imgaug/random.py
I would love this feature. natural sampling seems the best choice for augmentation generally speaking. Is this still planned?
I can look into this.
Problem Currently most augmentation use simple
random.uniform(lower_bound, upper_bound)
sampling rule to select the parameters to applied. This makes all value in[lower, upper]
range equally likely to occur.If someone, for example, uses
RandomGamma(gamma_limit=[60, 140])
this will produce extremely damaged images (gamma=60 or gamma=140) roughly as often as slightly damaged images (gamma close to 100). In some domains real distribution of parameters is also non-uniform, so having a way to sample slightly damaged images more often will be beneficial.Proposal Add option (flag?) to switch from uniform sampling to other types. Say, gaussian (skewed) sampling.