From 301b0d347c64a9846695c3249bcee8f338ee5860 Mon Sep 17 00:00:00 2001 From: littletomatodonkey <2120160898@bit.edu.cn> Date: Tue, 19 Jan 2021 21:03:13 +0800 Subject: [PATCH] fix duplicate (#1771) * fix duplicate * fix default action --- ppocr/postprocess/rec_postprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppocr/postprocess/rec_postprocess.py b/ppocr/postprocess/rec_postprocess.py index a18e101b..38d3b100 100644 --- a/ppocr/postprocess/rec_postprocess.py +++ b/ppocr/postprocess/rec_postprocess.py @@ -60,7 +60,7 @@ class BaseRecLabelDecode(object): def add_special_char(self, dict_character): return dict_character - def decode(self, text_index, text_prob=None, is_remove_duplicate=True): + def decode(self, text_index, text_prob=None, is_remove_duplicate=False): """ convert text-index into text-label. """ result_list = [] ignored_tokens = self.get_ignored_tokens() @@ -110,7 +110,7 @@ class CTCLabelDecode(BaseRecLabelDecode): text = self.decode(preds_idx, preds_prob) if label is None: return text - label = self.decode(label, is_remove_duplicate=False) + label = self.decode(label) return text, label def add_special_char(self, dict_character): -- GitLab