未验证 提交 45ec8d1b 编写于 作者: B Bubbliiiing 提交者: GitHub

Update utils.py

上级 a88d2a2b
......@@ -6,7 +6,7 @@ from PIL import Image
# 代码仅仅支持RGB图像的预测,所有其它类型的图像都会转化成RGB
#---------------------------------------------------------#
def cvtColor(image):
if len(np.shape(image)) == 3 and np.shape(image)[-2] == 3:
if len(np.shape(image)) == 3 and np.shape(image)[2] == 3:
return image
else:
image = image.convert('RGB')
......@@ -59,4 +59,4 @@ def get_lr(optimizer):
def preprocess_input(image):
image /= 255.0
return image
\ No newline at end of file
return image
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册