未验证 提交 6024fc9f 编写于 作者: D Double_V 提交者: GitHub

Update label_ops.py

上级 40098932
......@@ -438,7 +438,12 @@ class KieLabelEncode(object):
texts.append(ann['transcription'])
text_ind = [self.dict[c] for c in text if c in self.dict]
text_inds.append(text_ind)
labels.append(ann['label'])
if 'label' in ann.keys():
labels.append(ann['label'])
elif 'key_cls' in ann.keys():
labels.append(ann['key_cls'])
else:
raise ValueError("Cannot found 'key_cls' in ann.keys(), please check your training annotation.")
edges.append(ann.get('edge', 0))
ann_infos = dict(
image=data['image'],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册