commit
21b9bd6364
|
@ -285,7 +285,7 @@ class AttnLabelEncode(BaseRecLabelEncode):
|
||||||
text = self.encode(text)
|
text = self.encode(text)
|
||||||
if text is None:
|
if text is None:
|
||||||
return None
|
return None
|
||||||
if len(text) >= self.max_text_len:
|
if len(text) >= self.max_text_len - 1:
|
||||||
return None
|
return None
|
||||||
data['length'] = np.array(len(text))
|
data['length'] = np.array(len(text))
|
||||||
text = [0] + text + [len(self.character) - 1] + [0] * (self.max_text_len
|
text = [0] + text + [len(self.character) - 1] + [0] * (self.max_text_len
|
||||||
|
|
Loading…
Reference in New Issue