def load_image(path): img = image.load_img(path, target_size=(224,224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = preprocess_input(x) return np.asarray(x)