Search code examples
kerasdeep-learningconv-neural-networkdata-augmentation

Does ImageDataGenerator applies more than one transformation to a single image?


Consider the following code :

train_datagen=ImageDataGenerator(rescale=1/255,rotation_range=180, horizontal_flip=True)
training_set=train_datagen.flow_from_directory('dataset/training_set',target_size=(64,64),batch_size=32,class_mode='binary')

Can we have in this case the scenario in which the data generator applies both random rotation and horizontal flip to the same image ? Or only it can applies one transformation for an image ?


Solution

  • While using ImageDataGenerator in Keras, each of the transformations mentioned is applied.

    But there is a degree of randomness involved in how much each transformation is applied.

    Check this answer for code example