From 87ce916a2b8463dda351d9040dbf635caf758de5 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Tue, 30 Jun 2020 13:08:33 +0800 Subject: [PATCH] fix resize shape --- ppocr/data/rec/img_tools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ppocr/data/rec/img_tools.py b/ppocr/data/rec/img_tools.py index e8ac4622..3ca20f3f 100755 --- a/ppocr/data/rec/img_tools.py +++ b/ppocr/data/rec/img_tools.py @@ -97,7 +97,7 @@ def process_image(img, max_text_length=None, tps=None, infer_mode=False): - if not infer_mode or char_ops.character_type == "en" or tps != None: + if not infer_mode and (char_ops.character_type == "en" or tps != None): norm_img = resize_norm_img(img, image_shape) else: norm_img = resize_norm_img_chinese(img, image_shape) @@ -109,7 +109,8 @@ def process_image(img, logger.info( "Warning in ppocr/data/rec/img_tools.py:line106: Wrong data type." "Excepted string with length between 1 and {}, but " - "got '{}'. Label is '{}'".format(max_text_length, len(text),label)) + "got '{}'. Label is '{}'".format(max_text_length, + len(text), label)) return None else: if loss_type == "ctc": -- GitLab