Restore original images from X_test processed using `imagenet_utils.preprocess_input`
05:40 07 Nov 2025

I have train, validation and test datasets from the original corpora of images. Some of these images are grascale, some RGB and the grayscale images are converted to RGB using `tf.image.grayscale_to_rgb(image)`. These images are then processed using `tf.keras.applications.resnet_v2.preprocess_input`. I need to evaluate using the test dataset and show the result by plotting the images. How to restore those images which have been processed? The challenge here is to undo/reverse the operation done by both of these library functions.

tensorflow2.0 tf.keras data-preprocessing denormalization