I'm facing some troubles for creating tf.data.Dataset using image_dataset_from_directory for one to one task. That means I will give a model an input image and output will be another image.
My dataset directory is like this:
Dataset/
...input/
......a_image_1.jpg
......a_image_2.jpg
...output/
......a_image_1.jpg
......a_image_2.jpg
In the dataset directory corresponding input images and target images has same name. I'm trying to load dataset in following way:
dataset_url = "Project/Dataset"
input_size= 300
batch_size = 8
train_ds = image_dataset_from_directory(
dataset_url,
labels='inferred',
batch_size=batch_size,
image_size=(input_size, input_size),
validation_split=0.2,
subset="training",
seed=1337,
label_mode='int',
)
valid_ds = image_dataset_from_directory(
dataset_url,
labels='inferred',
batch_size=batch_size,
image_size=(input_size, input_size),
validation_split=0.2,
subset="validation",
seed=1337,
label_mode='int',
)
This process loads all the images in two folders as class 1 and 2. Now how can I map two classes as input and target? Am I in the right track? Is there any other way?