diff --git a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py index 55870a5016e7fbf2db3cef267f28a06fca25d378..7a32d870bfc7f532896ce6b11aac5508a6369993 100644 --- a/ppocr/data/imaug/label_ops.py +++ b/ppocr/data/imaug/label_ops.py @@ -215,7 +215,7 @@ class AttnLabelEncode(BaseRecLabelEncode): return None data['length'] = np.array(len(text)) text = [0] + text + [len(self.character) - 1] + [0] * (self.max_text_len - - len(text) - 1) + - len(text) - 2) data['label'] = np.array(text) return data @@ -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