def load_img(self, img_path): img = image.load_img(img_path, target_size=self.img_size) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) return preprocess_input(x)[0]