Suppose I have something like the following:
image_data_generator = ImageDataGenerator(rescale=1./255)
train_generator = image_data_generator.flow_from_directory(
'my_directory',
target_size=(28, 28),
batch_size=32,
class_mode='categorical'
)
Then my train_generator
is filled with data from my_directory
, which contains two subfolders which separate the data into classes 0
and 1
.
Suppose also I have another directory that_directory
, also with data split into classes 0
and 1
. I want to augment my train_generator
with this additional data.
Running train_generator = image_data_generator.flow_from_directory('that_directory', ...)
removes the prior data from my_directory
.
Is there a way to augment or append both sets of data into one generator or an object that operates like a DirectoryIterator
without changing the folder structure itself?