未验证 提交 a09604f8 编写于 作者: X xiaoting 提交者: GitHub

Merge pull request #2357 from caopulan/fix_srn_post

fix srn_postprocess
...@@ -216,6 +216,7 @@ class SRNLabelDecode(BaseRecLabelDecode): ...@@ -216,6 +216,7 @@ class SRNLabelDecode(BaseRecLabelDecode):
character_type='en', character_type='en',
use_space_char=False, use_space_char=False,
**kwargs): **kwargs):
self.max_text_length = kwargs['max_text_length']
super(SRNLabelDecode, self).__init__(character_dict_path, super(SRNLabelDecode, self).__init__(character_dict_path,
character_type, use_space_char) character_type, use_space_char)
...@@ -229,9 +230,9 @@ class SRNLabelDecode(BaseRecLabelDecode): ...@@ -229,9 +230,9 @@ class SRNLabelDecode(BaseRecLabelDecode):
preds_idx = np.argmax(pred, axis=1) preds_idx = np.argmax(pred, axis=1)
preds_prob = np.max(pred, axis=1) preds_prob = np.max(pred, axis=1)
preds_idx = np.reshape(preds_idx, [-1, 25]) preds_idx = np.reshape(preds_idx, [-1, self.max_text_length])
preds_prob = np.reshape(preds_prob, [-1, 25]) preds_prob = np.reshape(preds_prob, [-1, self.max_text_length])
text = self.decode(preds_idx, preds_prob) text = self.decode(preds_idx, preds_prob)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册