From 45ec8d1b655e27f10865fd277c111e2c1e0338bb Mon Sep 17 00:00:00 2001 From: Bubbliiiing <47347516+bubbliiiing@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:24:38 +0800 Subject: [PATCH] Update utils.py --- utils/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 4c122c2..4425553 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -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 -- GitLab