mdbloice / Augmentor

Image augmentation library in Python for machine learning.
https://augmentor.readthedocs.io/en/stable
MIT License
5.07k stars 866 forks source link

Is there a way to apply the same random crop? #200

Closed RifqiAW closed 5 years ago

RifqiAW commented 5 years ago

I wanted to apply the random crop for my video data how do I make sure that for frames of the same video it will crop the same part?

mdbloice commented 5 years ago

Hi @RifqiAW, I am not 100% sure what you mean. You mean that you have one video, and wish to pass this multiple times through a pipeline and get the same output out each time (for example the same crops every time, guaranteed)? I do not think you will be able to do this... I can only suggest you make the crops in a separate pass, save them to disk, and then use these crops as your data source for another pipeline.

RifqiAW commented 5 years ago

Yes, what I mean is for example a video is made of 75 images, and if I apply a random crop then it will crop at the same exact part for all 75 images. Guess I'll have to settle for a centered crop then? Thanks for the help.

mdbloice commented 5 years ago

Ah yes that is supported, you just have to pass all 75 images in a stack and use a DataPipeline, see

https://github.com/mdbloice/Augmentor#multiple-maskimage-augmentation

Maybe that helps? M.