def preprocess_image_array(imgArray, show_info=True):
"""
:param image:
:return:
"""
assert len(imgArray.shape) == 3
if (imgArray.shape[2]) == 1:
raise ValueError('Error: Preprocessing id done for color image only and input image is gray...')
utils.helper_functions.show_print_message("Now pre-processing the image to get ready for classification..", show_info)
img_array = np.expand_dims(imgArray, axis=0)
img_array = preprocess_input(img_array)
return img_array
评论列表
文章目录