diff --git a/ppocr/data/rec/img_tools.py b/ppocr/data/rec/img_tools.py index af7b23daf6575d430e9e4d4fdbd852ae03a07ab3..9edfff11f5701217d944410ddc25c2d698fd47ab 100755 --- a/ppocr/data/rec/img_tools.py +++ b/ppocr/data/rec/img_tools.py @@ -56,7 +56,7 @@ def resize_norm_img(img, image_shape): def resize_norm_img_chinese(img, image_shape): imgC, imgH, imgW = image_shape # todo: change to 0 and modified image shape - max_wh_ratio = 0 + max_wh_ratio = imgW * 1.0 / imgH h, w = img.shape[0], img.shape[1] ratio = w * 1.0 / h max_wh_ratio = max(max_wh_ratio, ratio)