def preprocessImage(imagePath):
img = load_img(imagePath, target_size=(244, 244))
img = img_to_array(img)
img = np.expand_dims(img, axis=0)
img = vgg16.preprocess_input(img)
img = img.reshape(img.shape[1:])
return img
评论列表
文章目录