未验证 提交 22db537e 编写于 作者: Z zhoujun 提交者: GitHub

Merge pull request #6352 from WenmuZhou/flk

add e2e metric and lite speed
...@@ -85,10 +85,16 @@ def convert_label(label_dir, mode="gt", save_dir="./save_results/"): ...@@ -85,10 +85,16 @@ def convert_label(label_dir, mode="gt", save_dir="./save_results/"):
print("The convert label saved in {}".format(save_dir)) print("The convert label saved in {}".format(save_dir))
if __name__ == "__main__": def parse_args():
import argparse
parser = argparse.ArgumentParser(description="args")
parser.add_argument("--label_path", type=str, required=True)
parser.add_argument("--save_folder", type=str, required=True)
parser.add_argument("--mode", type=str, default=False)
args = parser.parse_args()
return args
ppocr_label_gt = "/paddle/Datasets/chinese/test_set/Label_refine_310_V2.txt"
convert_label(ppocr_label_gt, "gt", "./save_gt_310_V2/")
ppocr_label_gt = "./infer_results/ch_PPOCRV2_infer.txt" if __name__ == "__main__":
convert_label(ppocr_label_gt_en, "pred", "./save_PPOCRV2_infer/") args = parse_args()
convert_label(args.label_path, args.mode, args.save_folder)
...@@ -23,19 +23,13 @@ all-sum-510/00224225.jpg [{"transcription": "超赞", "points": [[8.0, 48 ...@@ -23,19 +23,13 @@ all-sum-510/00224225.jpg [{"transcription": "超赞", "points": [[8.0, 48
**步骤二:** **步骤二:**
将步骤一保存的数据转换为端对端评测需要的数据格式: 将步骤一保存的数据转换为端对端评测需要的数据格式:
修改 `tools/convert_ppocr_label.py`中的代码,convert_label函数中设置输入标签路径,Mode,保存标签路径等,对预测数据的GTlabel和预测结果的label格式进行转换。
``` 修改 `tools/end2end/convert_ppocr_label.py`中的代码,convert_label函数中设置输入标签路径,Mode,保存标签路径等,对预测数据的GTlabel和预测结果的label格式进行转换。
ppocr_label_gt = "gt_label.txt"
convert_label(ppocr_label_gt, "gt", "./save_gt_label/")
ppocr_label_gt = "./ch_PP-OCRv2_results/system_results.txt"
convert_label(ppocr_label_gt_en, "pred", "./save_PPOCRV2_infer/")
``` ```
python3 tools/end2end/convert_ppocr_label.py --mode=gt --label_path=path/to/label_txt --save_folder=save_gt_label
运行`convert_ppocr_label.py`: python3 tools/end2end/convert_ppocr_label.py --mode=pred --label_path=path/to/pred_txt --save_folder=save_PPOCRV2_infer
```
python3 tools/convert_ppocr_label.py
``` ```
得到如下结果: 得到如下结果:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册