valid = tf.keras.preprocessing.image_dataset_from_directory(
'path',
labels="inferred",
label_mode="categorical",
class_names=["i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix", "x"],
shuffle=False,
seed=123,
batch_size=100000,
image_size=(32, 32),
)
predictions = model.predict(valid)
Is there a way to trace back from the prediction to the original image name? For instance, the prediction in row 2 belongs to path/i/image5.png.
Thank you for your help.