From a6f5282973321b452c399b87895dbb29adf50a31 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Thu, 12 May 2022 16:14:18 +0800 Subject: [PATCH] fix --- ppocr/data/imaug/label_ops.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py index 02a5187d..8b017b32 100644 --- a/ppocr/data/imaug/label_ops.py +++ b/ppocr/data/imaug/label_ops.py @@ -438,10 +438,10 @@ 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) - if 'label' in anno.keys(): + if 'label' in ann.keys(): labels.append(ann['label']) - elif 'key_cls' in anno.keys(): - labels.append(anno['key_cls']) + 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)) -- GitLab