From d179c7c4468da9f0bb38977febda51a9b495715c Mon Sep 17 00:00:00 2001 From: tink2123 Date: Sun, 16 Aug 2020 12:58:05 +0800 Subject: [PATCH] fix bug --- ppocr/utils/character.py | 2 +- tools/infer/utility.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ppocr/utils/character.py b/ppocr/utils/character.py index 575658ef..5f2963ac 100755 --- a/ppocr/utils/character.py +++ b/ppocr/utils/character.py @@ -25,7 +25,7 @@ class CharacterOps(object): def __init__(self, config): self.character_type = config['character_type'] self.loss_type = config['loss_type'] - self.max_text_len = 25 + self.max_text_len = config['max_text_length'] if self.character_type == "en": self.character_str = "0123456789abcdefghijklmnopqrstuvwxyz" dict_character = list(self.character_str) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index fe590c7e..fc91880e 100755 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -56,8 +56,8 @@ def parse_args(): #params for text recognizer parser.add_argument("--rec_algorithm", type=str, default='CRNN') parser.add_argument("--rec_model_dir", type=str) - parser.add_argument("--rec_image_shape", type=str, default="1, 64, 320") - parser.add_argument("--rec_char_type", type=str, default='en') + parser.add_argument("--rec_image_shape", type=str, default="3, 32, 320") + parser.add_argument("--rec_char_type", type=str, default='ch') parser.add_argument("--rec_batch_num", type=int, default=30) parser.add_argument( "--rec_char_dict_path", -- GitLab