aleju / imgaug

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

Track Random Augmentations as They Are Applied #836

Open aidansmyth95 opened 1 year ago

aidansmyth95 commented 1 year ago

I am working on a project where I am tracking the roll estimations for a face in an image. When I possibly rotate an image using a Sequence of probabilistic augmentations, I need to return the rotation that occurred (if any).

train_aug = Sequential( [ Resize(tgt_img_size[:2], interpolation="linear"), Fliplr(0.3), Sometimes(0.3, Affine(rotate=10)), ] )

Calling get_parameters() returns the distributions but not the parameters that were sampled from the distributions.

What I really need is something like: { flipped_lr: True, rotate: [True, -4.5] }

I would appreciate a code snippet demonstrating how people track imgaug operations performed like described above. I appreciate that this project is not being actively maintained, but I do believe that this already exists and I am just missing some documentation on it or a code example.

Thanks in advance.