How to use multiple image datasets as inputs and outputs for the Keras network?

Viewed 164

At the moment I'm trying to join a dataset that is scattered through different folders into one, this dataset have no labels as this is an autoencoder-like application. The code at the moment is creating the datasets like this:

#First data generator: original images
clean_datagen = preprocessing.image_dataset_from_directory(clean_path, label_mode=None, batch_size=batch_dimension, shuffle=False, validation_split = validation_partition, subset="validation")

#Second data generator: noisy images
noisy_datagen = preprocessing.image_dataset_from_directory(noisy_path, label_mode=None, batch_size=batch_dimension, shuffle=False, validation_split = validation_partition, subset="validation") 
                                           
#Third data generator: denoised images
denoised_datagen = preprocessing.image_dataset_from_directory(denoised_path, label_mode=None, batch_size=batch_dimension, shuffle=False, validation_split = validation_partition, subset="validation")

#Fourth data generator: noise levels
maps_datagen = preprocessing.text_dataset_from_directory(maps_path, label_mode=None, batch_size=batch_dimension, shuffle=False, validation_split = validation_partition, subset="validation")

The network takes inputs like this:

([x_images, x_noise_level_map, x_denoised], y_images)

where:

  • x_images should come from noisy_datagen
  • x_noise_level_map should come from map_datagen
  • x_denoised should come from denoised_datagen
  • y_images should come from clean_datagen

So I need to get those all together. Ive been lurking here and seeing people using flow_from_directory, and some of the methods that derive from it, but it seems to be deprecated. Any ideas on how to do this?

0 Answers
Related