From 3d8b42dc0c39fd3ab26251c9de21a1c0d414a7ef Mon Sep 17 00:00:00 2001 From: tink2123 Date: Mon, 8 Feb 2021 03:21:01 +0000 Subject: [PATCH] fix encode for srn --- ppocr/data/imaug/label_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py index fd6ba646..7a32d870 100644 --- a/ppocr/data/imaug/label_ops.py +++ b/ppocr/data/imaug/label_ops.py @@ -261,7 +261,7 @@ class SRNLabelEncode(BaseRecLabelEncode): if len(text) > self.max_text_len: return None data['length'] = np.array(len(text)) - text = text + [char_num] * (self.max_text_len - len(text)) + text = text + [char_num - 1] * (self.max_text_len - len(text)) data['label'] = np.array(text) return data -- GitLab