fix AttnLabelEncode out of max_text_len
This commit is contained in:
parent
25f30acb29
commit
0bca14593d
|
@ -283,7 +283,7 @@ class AttnLabelEncode(BaseRecLabelEncode):
|
|||
text = self.encode(text)
|
||||
if text is None:
|
||||
return None
|
||||
if len(text) >= self.max_text_len:
|
||||
if len(text) >= self.max_text_len - 1:
|
||||
return None
|
||||
data['length'] = np.array(len(text))
|
||||
text = [0] + text + [len(self.character) - 1] + [0] * (self.max_text_len
|
||||
|
|
Loading…
Reference in New Issue