From 243bd9944d3ae9f9c3c28e0116157737598ab3b9 Mon Sep 17 00:00:00 2001 From: Jethong <1147925384@qq.com> Date: Wed, 21 Apr 2021 14:36:50 +0800 Subject: [PATCH] add mode --- configs/e2e/e2e_r50_vd_pg.yml | 2 +- ppocr/data/imaug/label_ops.py | 4 ++-- ppocr/data/imaug/pg_process.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/e2e/e2e_r50_vd_pg.yml b/configs/e2e/e2e_r50_vd_pg.yml index 4c9e5387..2f1fab2e 100644 --- a/configs/e2e/e2e_r50_vd_pg.yml +++ b/configs/e2e/e2e_r50_vd_pg.yml @@ -63,7 +63,7 @@ PostProcess: Metric: name: E2EMetric - mode: A # A or B + mode: A # two ways for eval, A: label from txt, B: label from gt_mat gt_mat_dir: ./train_data/total_text/gt # the dir of gt_mat character_dict_path: ppocr/utils/ic15_dict.txt main_indicator: f_score_e2e diff --git a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py index 0e3e048c..0225001f 100644 --- a/ppocr/data/imaug/label_ops.py +++ b/ppocr/data/imaug/label_ops.py @@ -217,7 +217,7 @@ class E2ELabelEncode_test(BaseRecLabelEncode): boxes = np.array(boxes, dtype=np.float32) txt_tags = np.array(txt_tags, dtype=np.bool) data['polys'] = boxes - data['ignore_tags'] = txt_tags + data['tags'] = txt_tags temp_texts = [] for text in txts: text = text.lower() @@ -255,7 +255,7 @@ class E2ELabelEncode_train(object): data['polys'] = boxes data['texts'] = txts - data['ignore_tags'] = txt_tags + data['tags'] = txt_tags return data diff --git a/ppocr/data/imaug/pg_process.py b/ppocr/data/imaug/pg_process.py index 53031064..0012466b 100644 --- a/ppocr/data/imaug/pg_process.py +++ b/ppocr/data/imaug/pg_process.py @@ -750,7 +750,7 @@ class PGProcessTrain(object): input_size = 512 im = data['image'] text_polys = data['polys'] - text_tags = data['ignore_tags'] + text_tags = data['tags'] text_strs = data['texts'] h, w, _ = im.shape text_polys, text_tags, hv_tags = self.check_and_validate_polys( -- GitLab