The train_generator reads batches of RGB image data from disk using Keras flow_from_directory (example code below). But in my case, I have two directory of images such that I want to read a pair of images and stack them along the depth-axis to form a 6-channel image (i.e 2x R, 2x G, 2x B channels) before it goes to fit_generator.
So, my question is how to combine two RGB images along the depth axis to prepare 6-channel input data while using Keras flow_from_directory?
I'm following an example CNN code for classification from here:
https://gist.github.com/fchollet/0830affa1f7f19fd47b06d4cf89ed44d
train_generator = train_datagen.flow_from_directory(
train_data_dir,
target_size=(img_width, img_height),
batch_size=batch_size,
class_mode='binary')