未验证 提交 89ddde94 编写于 作者: Z zclzc 提交者: GitHub

Update img_tools.py

Fix bug when training with grayscale
上级 5fb3c419
......@@ -40,6 +40,7 @@ def resize_norm_img(img, image_shape):
resized_image = cv2.resize(img, (resized_w, imgH))
resized_image = resized_image.astype('float32')
if image_shape[0] == 1:
resized_image = cv2.cvtColor(resized_image, cv2.COLOR_BGR2GRAY)
resized_image = resized_image / 255
resized_image = resized_image[np.newaxis, :]
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册