|
|
|
@ -14,6 +14,8 @@ C++预测功能测试的主程序为`test_inference_cpp.sh`,可以测试基于
|
|
|
|
|
| 量化模型 | CPU | 1/6 | - | int8 | 支持 |
|
|
|
|
|
|
|
|
|
|
## 2. 测试流程
|
|
|
|
|
运行环境配置请参考[文档](./install.md)的内容配置TIPC的运行环境。
|
|
|
|
|
|
|
|
|
|
### 2.1 功能测试
|
|
|
|
|
先运行`prepare.sh`准备数据和模型,然后运行`test_inference_cpp.sh`进行测试,最终在```test_tipc/output```目录下生成`cpp_infer_*.log`后缀的日志文件。
|
|
|
|
|
|
|
|
|
@ -26,6 +28,32 @@ bash test_tipc/test_inference_cpp.sh ./test_tipc/configs/ppocr_det_mobile_params
|
|
|
|
|
bash test_tipc/test_inference_cpp.sh ./test_tipc/configs/ppocr_det_mobile_params.txt '1'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
运行预测指令后,在`test_tipc/output`文件夹下自动会保存运行日志,包括以下文件:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
test_tipc/output/
|
|
|
|
|
|- results_cpp.log # 运行指令状态的日志
|
|
|
|
|
|- cpp_infer_cpu_usemkldnn_False_threads_1_precision_fp32_batchsize_1.log # CPU上不开启Mkldnn,线程数设置为1,测试batch_size=1条件下的预测运行日志
|
|
|
|
|
|- cpp_infer_cpu_usemkldnn_False_threads_6_precision_fp32_batchsize_1.log # CPU上不开启Mkldnn,线程数设置为6,测试batch_size=1条件下的预测运行日志
|
|
|
|
|
|- cpp_infer_gpu_usetrt_False_precision_fp32_batchsize_1.log # GPU上不开启TensorRT,测试batch_size=1的fp32精度预测日志
|
|
|
|
|
|- cpp_infer_gpu_usetrt_True_precision_fp16_batchsize_1.log # GPU上开启TensorRT,测试batch_size=1的fp16精度预测日志
|
|
|
|
|
......
|
|
|
|
|
```
|
|
|
|
|
其中results_cpp.log中包含了每条指令的运行状态,如果运行成功会输出:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Run successfully with command - ./deploy/cpp_infer/build/ppocr det --use_gpu=False --enable_mkldnn=False --cpu_threads=6 --det_model_dir=./inference/ch_ppocr_mobile_v2.0_det_infer/ --rec_batch_num=1 --image_dir=./inference/ch_det_data_50/all-sum-510/ --benchmar k=True > ./test_tipc/output/cpp_infer_cpu_usemkldnn_False_threads_6_precision_fp32_batchsize_1.log 2>&1 !
|
|
|
|
|
Run successfully with command - ./deploy/cpp_infer/build/ppocr det --use_gpu=True --use_tensorrt=False --precision=fp32 --det_model_dir=./inference/ch_ppocr_mobile_v2.0_det_infer/ --rec_batch_num=1 --image_dir=./inference/ch_det_data_50/all-sum-510/ --benchmark =True > ./test_tipc/output/cpp_infer_gpu_usetrt_False_precision_fp32_batchsize_1.log 2>&1 !
|
|
|
|
|
......
|
|
|
|
|
```
|
|
|
|
|
如果运行失败,会输出:
|
|
|
|
|
```
|
|
|
|
|
Run failed with command - ./deploy/cpp_infer/build/ppocr det --use_gpu=True --use_tensorrt=True --precision=fp32 --det_model_dir=./inference/ch_ppocr_mobile_v2.0_det_infer/ --rec_batch_num=1 --image_dir=./inference/ch_det_data_50/all-sum-510/ --benchmark=True > ./test_tipc/output/cpp_infer_gpu_usetrt_True_precision_fp32_batchsize_1.log 2>&1 !
|
|
|
|
|
Run failed with command - ./deploy/cpp_infer/build/ppocr det --use_gpu=True --use_tensorrt=True --precision=fp16 --det_model_dir=./inference/ch_ppocr_mobile_v2.0_det_infer/ --rec_batch_num=1 --image_dir=./inference/ch_det_data_50/all-sum-510/ --benchmark=True > ./test_tipc/output/cpp_infer_gpu_usetrt_True_precision_fp16_batchsize_1.log 2>&1 !
|
|
|
|
|
......
|
|
|
|
|
```
|
|
|
|
|
可以很方便的根据results_cpp.log中的内容判定哪一个指令运行错误。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 2.2 精度测试
|
|
|
|
|
|
|
|
|
|