提交 243bd994 编写于 作者: J Jethong

add mode

上级 2f978f63
...@@ -63,7 +63,7 @@ PostProcess: ...@@ -63,7 +63,7 @@ PostProcess:
Metric: Metric:
name: E2EMetric 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 gt_mat_dir: ./train_data/total_text/gt # the dir of gt_mat
character_dict_path: ppocr/utils/ic15_dict.txt character_dict_path: ppocr/utils/ic15_dict.txt
main_indicator: f_score_e2e main_indicator: f_score_e2e
......
...@@ -217,7 +217,7 @@ class E2ELabelEncode_test(BaseRecLabelEncode): ...@@ -217,7 +217,7 @@ class E2ELabelEncode_test(BaseRecLabelEncode):
boxes = np.array(boxes, dtype=np.float32) boxes = np.array(boxes, dtype=np.float32)
txt_tags = np.array(txt_tags, dtype=np.bool) txt_tags = np.array(txt_tags, dtype=np.bool)
data['polys'] = boxes data['polys'] = boxes
data['ignore_tags'] = txt_tags data['tags'] = txt_tags
temp_texts = [] temp_texts = []
for text in txts: for text in txts:
text = text.lower() text = text.lower()
...@@ -255,7 +255,7 @@ class E2ELabelEncode_train(object): ...@@ -255,7 +255,7 @@ class E2ELabelEncode_train(object):
data['polys'] = boxes data['polys'] = boxes
data['texts'] = txts data['texts'] = txts
data['ignore_tags'] = txt_tags data['tags'] = txt_tags
return data return data
......
...@@ -750,7 +750,7 @@ class PGProcessTrain(object): ...@@ -750,7 +750,7 @@ class PGProcessTrain(object):
input_size = 512 input_size = 512
im = data['image'] im = data['image']
text_polys = data['polys'] text_polys = data['polys']
text_tags = data['ignore_tags'] text_tags = data['tags']
text_strs = data['texts'] text_strs = data['texts']
h, w, _ = im.shape h, w, _ = im.shape
text_polys, text_tags, hv_tags = self.check_and_validate_polys( text_polys, text_tags, hv_tags = self.check_and_validate_polys(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册