From f5f402e3fab164559b6667d2d72d63c00c5300e0 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Wed, 8 Sep 2021 15:57:18 +0800 Subject: [PATCH] polish tests for rec and server --- tests/ocr_ppocr_mobile_params.txt | 2 +- tests/ocr_ppocr_server_params.txt | 66 +++++++++++++++++++++++++++++++ tests/ocr_rec_params.txt | 17 +++++++- tests/prepare.sh | 9 ++++- 4 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 tests/ocr_ppocr_server_params.txt diff --git a/tests/ocr_ppocr_mobile_params.txt b/tests/ocr_ppocr_mobile_params.txt index 30b9a038..bb6e0960 100644 --- a/tests/ocr_ppocr_mobile_params.txt +++ b/tests/ocr_ppocr_mobile_params.txt @@ -1,5 +1,5 @@ ===========================train_params=========================== -model_name:ocr_system +model_name:ocr_system_mobile python:python3.7 gpu_list:null Global.use_gpu:null diff --git a/tests/ocr_ppocr_server_params.txt b/tests/ocr_ppocr_server_params.txt new file mode 100644 index 00000000..9c49f7dd --- /dev/null +++ b/tests/ocr_ppocr_server_params.txt @@ -0,0 +1,66 @@ +===========================train_params=========================== +model_name:ocr_system_server +python:python3.7 +gpu_list:null +Global.use_gpu:null +Global.auto_cast:null +Global.epoch_num:null +Global.save_model_dir:./output/ +Train.loader.batch_size_per_card:null +Global.pretrained_model:null +train_model_name:null +train_infer_img_dir:null +null:null +## +trainer: +norm_train:null +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================infer_params=========================== +Global.save_inference_dir:./output/ +Global.pretrained_model: +norm_export:null +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +## +infer_model:./inference/ch_ppocr_server_v2.0_det_infer/ +infer_export:null +infer_quant:False +inference:tools/infer/predict_system.py +--use_gpu:True +--enable_mkldnn:True|False +--cpu_threads:1|6 +--rec_batch_num:1 +--use_tensorrt:False|True +--precision:fp32|fp16|int8 +--det_model_dir: +--image_dir:./inference/ch_det_data_50/all-sum-510/ +--save_log_path:null +--benchmark:True +--rec_model_dir:./inference/ch_ppocr_server_v2.0_rec_infer/ +===========================cpp_infer_params=========================== +use_opencv:True +infer_model:./inference/ch_ppocr_server_v2.0_det_infer/ +infer_quant:False +inference:./deploy/cpp_infer/build/ppocr system +--use_gpu:True|False +--enable_mkldnn:True|False +--cpu_threads:1|6 +--rec_batch_num:1 +--use_tensorrt:False|True +--precision:fp32|fp16 +--det_model_dir: +--image_dir:./inference/ch_det_data_50/all-sum-510/ +--rec_model_dir:./inference/ch_ppocr_server_v2.0_rec_infer/ +--benchmark:True \ No newline at end of file diff --git a/tests/ocr_rec_params.txt b/tests/ocr_rec_params.txt index d1dc3c31..f9c40789 100644 --- a/tests/ocr_rec_params.txt +++ b/tests/ocr_rec_params.txt @@ -63,4 +63,19 @@ inference:./deploy/cpp_infer/build/ppocr rec --rec_model_dir: --image_dir:./inference/rec_inference/ null:null ---benchmark:True \ No newline at end of file +--benchmark:True +===========================serving_params=========================== +trans_model:-m paddle_serving_client.convert +--dirname:./inference/ch_ppocr_mobile_v2.0_rec_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--serving_server:./deploy/pdserving/ppocr_rec_mobile_2.0_serving/ +--serving_client:./deploy/pdserving/ppocr_rec_mobile_2.0_client/ +serving_dir:./deploy/pdserving +web_service:web_service_rec.py --config=config.yml --opt op.rec.concurrency=1 +op.rec.local_service_conf.devices:null|0 +op.rec.local_service_conf.use_mkldnn:True|False +op.rec.local_service_conf.thread_num:1|6 +op.rec.local_service_conf.use_trt:False|True +op.rec.local_service_conf.precision:fp32|fp16|int8 +pipline:pipeline_http_client.py --image_dir=../../doc/imgs_words_en \ No newline at end of file diff --git a/tests/prepare.sh b/tests/prepare.sh index 77fc46e0..a2ad4f71 100644 --- a/tests/prepare.sh +++ b/tests/prepare.sh @@ -75,12 +75,17 @@ elif [ ${MODE} = "infer" ];then wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_det_data_50.tar && cd ../ - elif [ ${model_name} = "ocr_system" ]; then + elif [ ${model_name} = "ocr_system_mobile" ]; then wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar cd ./inference && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../ - else + elif [ ${model_name} = "ocr_system_server" ]; then + wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar + wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar + wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar + cd ./inference && tar xf ch_ppocr_server_v2.0_det_infer.tar && tar xf ch_ppocr_server_v2.0_rec_infer.tar && tar xf ch_det_data_50.tar && cd ../ + else rm -rf ./train_data/ic15_data eval_model_name="ch_ppocr_mobile_v2.0_rec_infer" wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/rec_inference.tar -- GitLab