How to output the corresponding original picture after classification prediction?

Recently, I used my trained model to predict and classify a large number of new images, but I can only predict the type of each image. I can't find the original image of this image. My purpose is to sorted and saved each picture . Since my data was preprocessed by cropped and flipped, I don't know how to restore them.
I don't know how to do it, if you konw how to restore the pictures, please help me.
Any suggestions would be really helpful. Thanks in advance.

carrying Inference on a trained image, jsut predicts the class of the image. For example in my case,

I read one image at a time. You can easily automate this by writing another script that reads images from a folder one by one, predicts them and then based on the predicted class stores them in a new directory.

I hope I got your question because I was a bit confused first. :roll_eyes:

Thank you very much, I am sorry, my expression is not clear. Luckily, you got my question, In fact, I have been able to read and predict one image at a time, you are right, I need write another script that reads images from a folder one by one, Now I am trying to do this, thank you.

@xiao I would request you to please mark this discussion as solved so that it might be helpful for the further coming members to this post!