# Should the input data be normalized using keras pre-trained models

I want to use a pre-trained VGG16 in keras. My question is simple. Should I normalize the input image before predicting its label?

• I tried this from scipy import ndimage from keras.preprocessing import image from keras.applications.vgg16 import preprocess_input im = scipy.misc.imread("cat_dog/validation/cats/cat.1362.jpg").astype(np.float32) im = scipy.misc.imresize(im, (224, 224)).astype(np.float32) im = np.expand_dims(im, axis=0) # im = preprocess_input(im) out = vgg16_model.predict(im) np.argmax(out) I tried to comment/uncomment the preprocess_input(...) and it apparently gave the same results and I think both sort of worked. The source for preprocess_input seemed to be at: github.com/tensorflow/tensorflow/blob Feb 24, 2018 at 3:47

Checkout: tensorflow.keras.applications.vgg16.preprocess_input