aleju / imgaug

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

Is imgaug seeded by default? #121

Open CMCDragonkai opened 6 years ago

CMCDragonkai commented 6 years ago

I'm using imgaug in an augmentation script that takes a directory of images and creates a directory of augmented images.

I've noticed that every time I run this script, I get the same augmentations.

In order to get different augmentations, I have to change the seed: ia.seed(some_number).

Thus in order to get random augmented images, I would have to seed it with a random number by default?

aleju commented 6 years ago

Yes, the library is configured by default to always use the same seed in order to make experiments more reproducible. You can change that by calling ia.seed() as you said and providing it a random seed from e.g. numpy.

adriantre commented 4 years ago

@aleju what do you think about having imgaug listen to the numpy.random.seed? i.e. if np.random.seed is reset, then imgaug will reset. In my case I am using the Pytorch-Lightning funcion seed_everything to set seeds, which ideally could seed everything :)