From a88ce7a5b6d63eac69ab3363948de6146fa0de90 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Tue, 20 Oct 2020 16:08:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=AF=B9label=20decode?= =?UTF-8?q?=E6=97=B6=E9=87=8D=E5=A4=8D=E5=AD=97=E7=AC=A6=E4=BC=9A=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ppocr/postprocess/rec_postprocess.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ppocr/postprocess/rec_postprocess.py b/ppocr/postprocess/rec_postprocess.py index fae4f3d9..73dcdaae 100644 --- a/ppocr/postprocess/rec_postprocess.py +++ b/ppocr/postprocess/rec_postprocess.py @@ -70,6 +70,7 @@ class BaseRecLabelDecode(object): if text_index[batch_idx][idx] in ignored_tokens: continue if is_remove_duplicate: + # only for predict if idx > 0 and text_index[batch_idx][idx - 1] == text_index[ batch_idx][idx]: continue @@ -107,7 +108,7 @@ class CTCLabelDecode(BaseRecLabelDecode): text = self.decode(preds_idx, preds_prob) if label is None: return text - label = self.decode(label) + label = self.decode(label, is_remove_duplicate=False) return text, label def add_special_char(self, dict_character): -- GitLab