I have a standard CNN for image classification, using the following generator to get the dataset:
generator = validation_image_generator.flow_from_directory(batch_size=BATCH_SIZE,
directory=val_dir,
shuffle=False,
target_size=(100,100),
class_mode='categorical')
I can easily get the predicted labels with:
predictions = model.predict(dataset)
Now I want to get the (original) true labels and images for all the predictions, in the same order as the predictions in order to compare them. I am sure that information is easily stored somewhere, but I haven't been able to find it.