mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2026-09-24 23:33:08 +08:00
Merge pull request #4686 from MissPenguin/dygraph
rename model name and add slim models
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
===========================lite_params===========================
|
||||
inference:./ocr_db_crnn det
|
||||
infer_model:ch_PP-OCRv2_det_infer|ch_PP-OCRv2_det_slim_quant_infer
|
||||
runtime_device:ARM_CPU
|
||||
--cpu_threads:1|4
|
||||
--det_batch_size:1
|
||||
--rec_batch_size:1
|
||||
--system_batch_size:1
|
||||
--image_dir:./test_data/icdar2015_lite/text_localization/ch4_test_images/
|
||||
--config_dir:./config.txt
|
||||
--rec_dict_dir:./ppocr_keys_v1.txt
|
||||
--benchmark:True
|
||||
+1
-1
@@ -10,4 +10,4 @@ null:null
|
||||
--image_dir:./test_data/icdar2015_lite/text_localization/ch4_test_images/
|
||||
--config_dir:./config.txt
|
||||
null:null
|
||||
--benchmark:True
|
||||
--benchmark:True
|
||||
@@ -20,12 +20,12 @@ C++预测功能测试的主程序为`test_inference_cpp.sh`,可以测试基于
|
||||
先运行`prepare.sh`准备数据和模型,然后运行`test_inference_cpp.sh`进行测试,最终在```test_tipc/output```目录下生成`cpp_infer_*.log`后缀的日志文件。
|
||||
|
||||
```shell
|
||||
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt "cpp_infer"
|
||||
bash test_tipc/prepare.sh ./test_tipc/configs/ch_ppocr_mobile_v2.0_det/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt "cpp_infer"
|
||||
|
||||
# 用法1:
|
||||
bash test_tipc/test_inference_cpp.sh test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt
|
||||
bash test_tipc/test_inference_cpp.sh test_tipc/configs/ch_ppocr_mobile_v2.0_det/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt
|
||||
# 用法2: 指定GPU卡预测,第三个传入参数为GPU卡号
|
||||
bash test_tipc/test_inference_cpp.sh test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt '1'
|
||||
bash test_tipc/test_inference_cpp.sh test_tipc/configs/ch_ppocr_mobile_v2.0_det/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt '1'
|
||||
```
|
||||
|
||||
运行预测指令后,在`test_tipc/output`文件夹下自动会保存运行日志,包括以下文件:
|
||||
|
||||
+21
-19
@@ -23,14 +23,17 @@
|
||||
|
||||
| 算法论文 | 模型名称 | 模型类型 | 基础<br>训练预测 | 更多<br>训练方式 | 模型压缩 | 其他预测部署 |
|
||||
| :--- | :--- | :----: | :--------: | :---- | :---- | :---- |
|
||||
| DB |ch_ppocr_mobile_v2.0_det | 检测 | 支持 | 多机多卡 <br> 混合精度 | FPGM裁剪 <br> 离线量化| Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| DB |ch_ppocr_server_v2.0_det | 检测 | 支持 | 多机多卡 <br> 混合精度 | FPGM裁剪 <br> 离线量化| Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| DB |ch_ppocr_mobile_v2.0_det | 检测 | 支持 | 多机多卡 <br> 混合精度 | - | Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| DB |ch_ppocr_mobile_v2.0_det_FPGM | 检测 | 支持 | 多机多卡 <br> 混合精度 | FPGM裁剪 | Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| DB |ch_ppocr_mobile_v2.0_det_PACT | 检测 | 支持 | 多机多卡 <br> 混合精度 | PACT量化 | Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| DB |ch_ppocr_mobile_v2.0_det_KL | 检测 | 支持 | 多机多卡 <br> 混合精度 | 离线量化| Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| DB |ch_ppocr_server_v2.0_det | 检测 | 支持 | 多机多卡 <br> 混合精度 | - | Paddle Inference: C++ <br> Paddle Serving: Python, C++ |
|
||||
| DB |ch_PP-OCRv2_det | 检测 |
|
||||
| CRNN |ch_ppocr_mobile_v2.0_rec | 识别 | 支持 | 多机多卡 <br> 混合精度 | PACT量化 <br> 离线量化| Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| CRNN |ch_ppocr_server_v2.0_rec | 识别 | 支持 | 多机多卡 <br> 混合精度 | PACT量化 <br> 离线量化| Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| CRNN |ch_ppocr_mobile_v2.0_rec | 识别 | 支持 | 多机多卡 <br> 混合精度 | - | Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| CRNN |ch_ppocr_server_v2.0_rec | 识别 | 支持 | 多机多卡 <br> 混合精度 | - | Paddle Inference: C++ <br> Paddle Serving: Python, C++ |
|
||||
| CRNN |ch_PP-OCRv2_rec | 识别 |
|
||||
| PP-OCR |ch_ppocr_mobile_v2.0 | 检测+识别 | 支持 | 多机多卡 <br> 混合精度 | - | Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| PP-OCR |ch_ppocr_server_v2.0 | 检测+识别 | 支持 | 多机多卡 <br> 混合精度 | - | Paddle Inference: C++ <br> Paddle Serving: Python, C++ <br> Paddle-Lite: <br> (1) ARM CPU(C++) |
|
||||
| PP-OCR |ch_ppocr_server_v2.0 | 检测+识别 | 支持 | 多机多卡 <br> 混合精度 | - | Paddle Inference: C++ <br> Paddle Serving: Python, C++ |
|
||||
|PP-OCRv2|ch_PP-OCRv2 | 检测+识别 |
|
||||
| DB |det_mv3_db_v2.0 | 检测 |
|
||||
| DB |det_r50_vd_db_v2.0 | 检测 |
|
||||
@@ -54,24 +57,23 @@
|
||||
|
||||
|
||||
|
||||
## 3. 一键测试工具使用
|
||||
## 3. 测试工具简介
|
||||
### 目录介绍
|
||||
|
||||
```shell
|
||||
test_tipc/
|
||||
├── configs/ # 配置文件目录
|
||||
├── ppocr_det_mobile # ppocr_det_mobile模型的测试配置文件目录
|
||||
├── det_mv3_db.yml # 测试mobile版ppocr检测模型训练的yml文件
|
||||
├── train_infer_python.txt.txt # 测试Linux上python训练预测(基础训练预测)的配置文件
|
||||
├── ch_ppocr_mobile_v2.0_det # ch_ppocr_mobile_v2.0_det模型的测试配置文件目录
|
||||
├── train_infer_python.txt # 测试Linux上python训练预测(基础训练预测)的配置文件
|
||||
├── model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt # 测试Linux上c++预测的配置文件
|
||||
├── model_linux_gpu_normal_normal_infer_python_jetson.txt # 测试Jetson上python预测的配置文件
|
||||
├── train_linux_gpu_fleet_amp_infer_python_linux_gpu_cpu.txt # 测试Linux上多机多卡、混合精度训练和python预测的配置文件
|
||||
├── ...
|
||||
├── ppocr_det_server # ppocr_det_server模型的测试配置文件目录
|
||||
├── ch_ppocr_server_v2.0_det # ch_ppocr_server_v2.0_det模型的测试配置文件目录
|
||||
├── ...
|
||||
├── ppocr_rec_mobile # ppocr_rec_mobile模型的测试配置文件目录
|
||||
├── ch_ppocr_mobile_v2.0_rec # ch_ppocr_mobile_v2.0_rec模型的测试配置文件目录
|
||||
├── ...
|
||||
├── ppocr_rec_server # ppocr_rec_server模型的测试配置文件目录
|
||||
├── ch_ppocr_server_v2.0_det # ch_ppocr_server_v2.0_det模型的测试配置文件目录
|
||||
├── ...
|
||||
├── ...
|
||||
├── results/ # 预先保存的预测结果,用于和实际预测结果进行精读比对
|
||||
@@ -91,18 +93,18 @@ test_tipc/
|
||||
```
|
||||
|
||||
### 配置文件命名规范
|
||||
在`configs`目录下,按模型名称划分为子目录,子目录中存放所有该模型测试需要用到的配置文件,配置文件的命名遵循如下规范:
|
||||
在`configs`目录下,**按模型名称划分为子目录**,子目录中存放所有该模型测试需要用到的配置文件,配置文件的命名遵循如下规范:
|
||||
|
||||
1. 基础训练预测配置简单命名为:`train_infer_python.txt`,表示**Linux环境下单机、不使用混合精度训练+python预测**,其完整命名对应`train_linux_gpu_fleet_amp_infer_python_linux_gpu_cpu.txt`,由于本配置文件使用频率较高,这里进行了名称简化。
|
||||
1. 基础训练预测配置简单命名为:`train_infer_python.txt`,表示**Linux环境下单机、不使用混合精度训练+python预测**,其完整命名对应`train_linux_gpu_normal_normal_infer_python_linux_gpu_cpu.txt`,由于本配置文件使用频率较高,这里进行了名称简化。
|
||||
|
||||
2. 其他带训练配置命名格式为:`train_训练硬件环境(linux_gpu/linux_dcu/…)_是否多机(fleet/normal)_是否混合精度(amp/normal)_预测模式(infer/lite/serving/js)_语言(cpp/python/java)_预测硬件环境(linux_gpu/mac/jetson/opencl_arm_gpu/...).txt`。如,linux gpu下多机多卡+混合精度链条测试对应配置 `train_linux_gpu_fleet_amp_infer_python_linux_gpu_cpu.txt`,linux dcu下基础训练预测对应配置 `train_linux_dcu_normal_normal_infer_python_dcu.txt`。
|
||||
2. 其他带训练配置命名格式为:`train_训练硬件环境(linux_gpu/linux_dcu/…)_是否多机(fleet/normal)_是否混合精度(amp/normal)_预测模式(infer/lite/serving/js)_语言(cpp/python/java)_预测硬件环境(linux_gpu/mac/jetson/opencl_arm_gpu/...).txt`。如,linux gpu下多机多卡+混合精度链条测试对应配置 `train_linux_gpu_fleet_amp_infer_python_linux_gpu_cpu.txt`,linux dcu下基础训练预测对应配置 `train_linux_dcu_normal_normal_infer_python_linux_dcu.txt`。
|
||||
|
||||
3. 仅预测的配置(如serving、lite等)命名格式:`model_训练硬件环境(linux_gpu/linux_dcu/…)_是否多机(fleet/normal)_是否混合精度(amp/normal)_(infer/lite/serving/js)_语言(cpp/python/java)_预测硬件环境(linux_gpu/mac/jetson/opencl_arm_gpu/...).txt`,即,与2相比,仅第一个字段从train换为model,测试时模型直接下载获取,这里的“训练硬件环境”表示所测试的模型是在哪种环境下训练得到的。
|
||||
|
||||
根据上述命名规范,可以直接从配置文件名看出对应的测试场景和功能。
|
||||
根据上述命名规范,可以直接从子目录名称和配置文件名找到需要测试的场景和功能对应的配置文件。
|
||||
|
||||
### 测试流程
|
||||
使用本工具,可以测试不同功能的支持情况,以及预测结果是否对齐,测试流程如下:
|
||||
### 测试流程概述
|
||||
使用本工具,可以测试不同功能的支持情况,以及预测结果是否对齐,测试流程概括如下:
|
||||
<div align="center">
|
||||
<img src="docs/test.png" width="800">
|
||||
</div>
|
||||
@@ -119,7 +121,7 @@ test_tipc/
|
||||
- `test_paddle2onnx.sh`:测试Paddle2ONNX的模型转化功能,并验证正确性。
|
||||
|
||||
<a name="more"></a>
|
||||
#### 更多教程
|
||||
### 更多教程
|
||||
各功能测试中涉及混合精度、裁剪、量化等训练相关,及mkldnn、Tensorrt等多种预测相关参数配置,请点击下方相应链接了解更多细节和使用教程:
|
||||
[test_train_inference_python 使用](docs/test_train_inference_python.md)
|
||||
[test_inference_cpp 使用](docs/test_inference_cpp.md)
|
||||
|
||||
Reference in New Issue
Block a user