From 05a9bacd274ab358e2219fb7d4a318459ff35347 Mon Sep 17 00:00:00 2001 From: MissPenguin Date: Tue, 19 Oct 2021 03:27:18 +0000 Subject: [PATCH] rename tests to PTDN --- {tests => PTDN}/common_func.sh | 0 {tests => PTDN}/compare_results.py | 0 {tests => PTDN}/configs/det_mv3_db.yml | 0 {tests => PTDN}/configs/det_r50_vd_db.yml | 0 .../configs/ppocr_det_mobile_params.txt | 0 .../configs/ppocr_det_server_params.txt | 0 .../configs/ppocr_rec_mobile_params.txt | 0 .../configs/ppocr_rec_server_params.txt | 0 .../configs/ppocr_sys_mobile_params.txt | 0 .../configs/ppocr_sys_server_params.txt | 0 .../configs/rec_icdar15_r34_train.yml | 0 {tests => PTDN}/docs/compare_cpp_right.png | Bin {tests => PTDN}/docs/compare_cpp_wrong.png | Bin {tests => PTDN}/docs/compare_right.png | Bin {tests => PTDN}/docs/compare_wrong.png | Bin {tests => PTDN}/docs/guide.png | Bin {tests => PTDN}/docs/test.png | Bin {tests => PTDN}/docs/test_cpp.md | 0 {tests => PTDN}/docs/test_python.md | 0 {tests => PTDN}/prepare.sh | 0 {tests => PTDN}/readme.md | 0 PTDN/readme.md.bk | 72 ++++++++++++++++++ .../cpp_ppocr_det_mobile_results_fp16.txt | 0 .../cpp_ppocr_det_mobile_results_fp32.txt | 0 .../python_ppocr_det_mobile_results_fp16.txt | 0 .../python_ppocr_det_mobile_results_fp32.txt | 0 {tests => PTDN}/test_cpp.sh | 0 {tests => PTDN}/test_python.sh | 0 {tests => PTDN}/test_serving.sh | 0 29 files changed, 72 insertions(+) rename {tests => PTDN}/common_func.sh (100%) rename {tests => PTDN}/compare_results.py (100%) rename {tests => PTDN}/configs/det_mv3_db.yml (100%) rename {tests => PTDN}/configs/det_r50_vd_db.yml (100%) rename {tests => PTDN}/configs/ppocr_det_mobile_params.txt (100%) rename {tests => PTDN}/configs/ppocr_det_server_params.txt (100%) rename {tests => PTDN}/configs/ppocr_rec_mobile_params.txt (100%) rename {tests => PTDN}/configs/ppocr_rec_server_params.txt (100%) rename {tests => PTDN}/configs/ppocr_sys_mobile_params.txt (100%) rename {tests => PTDN}/configs/ppocr_sys_server_params.txt (100%) rename {tests => PTDN}/configs/rec_icdar15_r34_train.yml (100%) rename {tests => PTDN}/docs/compare_cpp_right.png (100%) rename {tests => PTDN}/docs/compare_cpp_wrong.png (100%) rename {tests => PTDN}/docs/compare_right.png (100%) rename {tests => PTDN}/docs/compare_wrong.png (100%) rename {tests => PTDN}/docs/guide.png (100%) rename {tests => PTDN}/docs/test.png (100%) rename {tests => PTDN}/docs/test_cpp.md (100%) rename {tests => PTDN}/docs/test_python.md (100%) rename {tests => PTDN}/prepare.sh (100%) rename {tests => PTDN}/readme.md (100%) create mode 100644 PTDN/readme.md.bk rename {tests => PTDN}/results/cpp_ppocr_det_mobile_results_fp16.txt (100%) rename {tests => PTDN}/results/cpp_ppocr_det_mobile_results_fp32.txt (100%) rename {tests => PTDN}/results/python_ppocr_det_mobile_results_fp16.txt (100%) rename {tests => PTDN}/results/python_ppocr_det_mobile_results_fp32.txt (100%) rename {tests => PTDN}/test_cpp.sh (100%) rename {tests => PTDN}/test_python.sh (100%) rename {tests => PTDN}/test_serving.sh (100%) diff --git a/tests/common_func.sh b/PTDN/common_func.sh similarity index 100% rename from tests/common_func.sh rename to PTDN/common_func.sh diff --git a/tests/compare_results.py b/PTDN/compare_results.py similarity index 100% rename from tests/compare_results.py rename to PTDN/compare_results.py diff --git a/tests/configs/det_mv3_db.yml b/PTDN/configs/det_mv3_db.yml similarity index 100% rename from tests/configs/det_mv3_db.yml rename to PTDN/configs/det_mv3_db.yml diff --git a/tests/configs/det_r50_vd_db.yml b/PTDN/configs/det_r50_vd_db.yml similarity index 100% rename from tests/configs/det_r50_vd_db.yml rename to PTDN/configs/det_r50_vd_db.yml diff --git a/tests/configs/ppocr_det_mobile_params.txt b/PTDN/configs/ppocr_det_mobile_params.txt similarity index 100% rename from tests/configs/ppocr_det_mobile_params.txt rename to PTDN/configs/ppocr_det_mobile_params.txt diff --git a/tests/configs/ppocr_det_server_params.txt b/PTDN/configs/ppocr_det_server_params.txt similarity index 100% rename from tests/configs/ppocr_det_server_params.txt rename to PTDN/configs/ppocr_det_server_params.txt diff --git a/tests/configs/ppocr_rec_mobile_params.txt b/PTDN/configs/ppocr_rec_mobile_params.txt similarity index 100% rename from tests/configs/ppocr_rec_mobile_params.txt rename to PTDN/configs/ppocr_rec_mobile_params.txt diff --git a/tests/configs/ppocr_rec_server_params.txt b/PTDN/configs/ppocr_rec_server_params.txt similarity index 100% rename from tests/configs/ppocr_rec_server_params.txt rename to PTDN/configs/ppocr_rec_server_params.txt diff --git a/tests/configs/ppocr_sys_mobile_params.txt b/PTDN/configs/ppocr_sys_mobile_params.txt similarity index 100% rename from tests/configs/ppocr_sys_mobile_params.txt rename to PTDN/configs/ppocr_sys_mobile_params.txt diff --git a/tests/configs/ppocr_sys_server_params.txt b/PTDN/configs/ppocr_sys_server_params.txt similarity index 100% rename from tests/configs/ppocr_sys_server_params.txt rename to PTDN/configs/ppocr_sys_server_params.txt diff --git a/tests/configs/rec_icdar15_r34_train.yml b/PTDN/configs/rec_icdar15_r34_train.yml similarity index 100% rename from tests/configs/rec_icdar15_r34_train.yml rename to PTDN/configs/rec_icdar15_r34_train.yml diff --git a/tests/docs/compare_cpp_right.png b/PTDN/docs/compare_cpp_right.png similarity index 100% rename from tests/docs/compare_cpp_right.png rename to PTDN/docs/compare_cpp_right.png diff --git a/tests/docs/compare_cpp_wrong.png b/PTDN/docs/compare_cpp_wrong.png similarity index 100% rename from tests/docs/compare_cpp_wrong.png rename to PTDN/docs/compare_cpp_wrong.png diff --git a/tests/docs/compare_right.png b/PTDN/docs/compare_right.png similarity index 100% rename from tests/docs/compare_right.png rename to PTDN/docs/compare_right.png diff --git a/tests/docs/compare_wrong.png b/PTDN/docs/compare_wrong.png similarity index 100% rename from tests/docs/compare_wrong.png rename to PTDN/docs/compare_wrong.png diff --git a/tests/docs/guide.png b/PTDN/docs/guide.png similarity index 100% rename from tests/docs/guide.png rename to PTDN/docs/guide.png diff --git a/tests/docs/test.png b/PTDN/docs/test.png similarity index 100% rename from tests/docs/test.png rename to PTDN/docs/test.png diff --git a/tests/docs/test_cpp.md b/PTDN/docs/test_cpp.md similarity index 100% rename from tests/docs/test_cpp.md rename to PTDN/docs/test_cpp.md diff --git a/tests/docs/test_python.md b/PTDN/docs/test_python.md similarity index 100% rename from tests/docs/test_python.md rename to PTDN/docs/test_python.md diff --git a/tests/prepare.sh b/PTDN/prepare.sh similarity index 100% rename from tests/prepare.sh rename to PTDN/prepare.sh diff --git a/tests/readme.md b/PTDN/readme.md similarity index 100% rename from tests/readme.md rename to PTDN/readme.md diff --git a/PTDN/readme.md.bk b/PTDN/readme.md.bk new file mode 100644 index 00000000..127eef9f --- /dev/null +++ b/PTDN/readme.md.bk @@ -0,0 +1,72 @@ + +# 从训练到推理部署工具链测试方法介绍 + +test.sh和params.txt文件配合使用,完成OCR轻量检测和识别模型从训练到预测的流程测试。 + +# 安装依赖 +- 安装PaddlePaddle >= 2.0 +- 安装PaddleOCR依赖 + ``` + pip3 install -r ../requirements.txt + ``` +- 安装autolog + ``` + git clone https://github.com/LDOUBLEV/AutoLog + cd AutoLog + pip3 install -r requirements.txt + python3 setup.py bdist_wheel + pip3 install ./dist/auto_log-1.0.0-py3-none-any.whl + cd ../ + ``` + +# 目录介绍 + +```bash +tests/ +├── ocr_det_params.txt # 测试OCR检测模型的参数配置文件 +├── ocr_rec_params.txt # 测试OCR识别模型的参数配置文件 +├── ocr_ppocr_mobile_params.txt # 测试OCR检测+识别模型串联的参数配置文件 +└── prepare.sh # 完成test.sh运行所需要的数据和模型下载 +└── test.sh # 测试主程序 +``` + +# 使用方法 + +test.sh包含四种运行模式,每种模式的运行数据不同,分别用于测试速度和精度,分别是: + +- 模式1:lite_train_infer,使用少量数据训练,用于快速验证训练到预测的走通流程,不验证精度和速度; +```shell +bash tests/prepare.sh ./tests/ocr_det_params.txt 'lite_train_infer' +bash tests/test.sh ./tests/ocr_det_params.txt 'lite_train_infer' +``` + +- 模式2:whole_infer,使用少量数据训练,一定量数据预测,用于验证训练后的模型执行预测,预测速度是否合理; +```shell +bash tests/prepare.sh ./tests/ocr_det_params.txt 'whole_infer' +bash tests/test.sh ./tests/ocr_det_params.txt 'whole_infer' +``` + +- 模式3:infer 不训练,全量数据预测,走通开源模型评估、动转静,检查inference model预测时间和精度; +```shell +bash tests/prepare.sh ./tests/ocr_det_params.txt 'infer' +# 用法1: +bash tests/test.sh ./tests/ocr_det_params.txt 'infer' +# 用法2: 指定GPU卡预测,第三个传入参数为GPU卡号 +bash tests/test.sh ./tests/ocr_det_params.txt 'infer' '1' +``` + +- 模式4:whole_train_infer , CE: 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度; +```shell +bash tests/prepare.sh ./tests/ocr_det_params.txt 'whole_train_infer' +bash tests/test.sh ./tests/ocr_det_params.txt 'whole_train_infer' +``` + +- 模式5:cpp_infer , CE: 验证inference model的c++预测是否走通; +```shell +bash tests/prepare.sh ./tests/ocr_det_params.txt 'cpp_infer' +bash tests/test.sh ./tests/ocr_det_params.txt 'cpp_infer' +``` + +# 日志输出 +最终在```tests/output```目录下生成.log后缀的日志文件 + diff --git a/tests/results/cpp_ppocr_det_mobile_results_fp16.txt b/PTDN/results/cpp_ppocr_det_mobile_results_fp16.txt similarity index 100% rename from tests/results/cpp_ppocr_det_mobile_results_fp16.txt rename to PTDN/results/cpp_ppocr_det_mobile_results_fp16.txt diff --git a/tests/results/cpp_ppocr_det_mobile_results_fp32.txt b/PTDN/results/cpp_ppocr_det_mobile_results_fp32.txt similarity index 100% rename from tests/results/cpp_ppocr_det_mobile_results_fp32.txt rename to PTDN/results/cpp_ppocr_det_mobile_results_fp32.txt diff --git a/tests/results/python_ppocr_det_mobile_results_fp16.txt b/PTDN/results/python_ppocr_det_mobile_results_fp16.txt similarity index 100% rename from tests/results/python_ppocr_det_mobile_results_fp16.txt rename to PTDN/results/python_ppocr_det_mobile_results_fp16.txt diff --git a/tests/results/python_ppocr_det_mobile_results_fp32.txt b/PTDN/results/python_ppocr_det_mobile_results_fp32.txt similarity index 100% rename from tests/results/python_ppocr_det_mobile_results_fp32.txt rename to PTDN/results/python_ppocr_det_mobile_results_fp32.txt diff --git a/tests/test_cpp.sh b/PTDN/test_cpp.sh similarity index 100% rename from tests/test_cpp.sh rename to PTDN/test_cpp.sh diff --git a/tests/test_python.sh b/PTDN/test_python.sh similarity index 100% rename from tests/test_python.sh rename to PTDN/test_python.sh diff --git a/tests/test_serving.sh b/PTDN/test_serving.sh similarity index 100% rename from tests/test_serving.sh rename to PTDN/test_serving.sh