From 13e59395cc1b0cfaa7f81a271f32e0fc83c07e6b Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Fri, 10 Jul 2020 15:39:42 +0800 Subject: [PATCH] add warning when label length greater than setting length --- ppocr/data/rec/img_tools.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ppocr/data/rec/img_tools.py b/ppocr/data/rec/img_tools.py index 6e3577aa..d41abd9b 100755 --- a/ppocr/data/rec/img_tools.py +++ b/ppocr/data/rec/img_tools.py @@ -359,6 +359,11 @@ def process_image(img, # char_num = char_ops.get_char_num() text = char_ops.encode(label) if len(text) == 0 or len(text) > max_text_length: + logger.info( + "Warning in ppocr/data/rec/img_tools.py:line362: Wrong data type." + "Excepted string with length between 1 and {}, but " + "got '{}'. Label is '{}'".format(max_text_length, + len(text), label)) return None else: if loss_type == "ctc": -- GitLab