From a502db33ac8ec44c4c1b770c99274c831a182897 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Thu, 15 Oct 2020 20:56:29 +0800 Subject: [PATCH] fix max_img_ratio for short text --- ppocr/data/rec/img_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/data/rec/img_tools.py b/ppocr/data/rec/img_tools.py index af7b23da..9edfff11 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) -- GitLab