I am using tf.keras.utils.image_dataset_from_directory
in my binary classification Mobilenet V2 model to split the dataset by defining training and validation subsets as following:
train_dataset = tf.keras.utils.image_dataset_from_directory(directory,
shuffle=True,
batch_size=BATCH_SIZE,
image_size=IMG_SIZE,
validation_split=0.2,
subset='training',
seed=42)
validation_dataset = tf.keras.utils.image_dataset_from_directory(directory,
shuffle=True,
batch_size=BATCH_SIZE,
image_size=IMG_SIZE,
validation_split=0.2,
subset='validation',
seed=42)
Now, I want to use model.predict()
on a set of images to look at the predictions. How can I use image_dataset_from_directory
considering that there won't be two different folders containing the respective classes but only one folder for which I want the predictions? In addition, what should be the parameters of the image_dataset_from_directory
function now?