I have a dataset of images whith some of them that I need to flip before processing.
I use the keras function flow_from_dataframe
from the keras class ImageDataGenerator
to get the train and validation DataFrameIterator
but I can't find how to flip (not randomly) the images I want.
My dataframe has these three columns :
filename
: the filename of an imageclass
: the target datashould_be_flipped
: a boolean that say if the image should be flipped before the training
Is there a way to achieve this woth keras included functions ? I saw that ImageDataGenerator
has a preprocessing_function
parameter but it doesn't allow to be conditional...