diff --git a/ppocr/data/rec/img_tools.py b/ppocr/data/rec/img_tools.py index 8b497e6b803ba0fffaefc3e12c366130504b9ce0..9230ee5eaa64a2933b2ec87eb737d6ba31396865 100755 --- a/ppocr/data/rec/img_tools.py +++ b/ppocr/data/rec/img_tools.py @@ -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: