diff --git a/deploy/configs/inference_rec.yaml b/deploy/configs/inference_rec.yaml index d224deabcc4be2179acc0e38a9b2ae5f7e39e7d8..b821ebe54db2f6297fbdb74bb038df41dccd7529 100644 --- a/deploy/configs/inference_rec.yaml +++ b/deploy/configs/inference_rec.yaml @@ -15,14 +15,15 @@ Global: RecPreProcess: transform_ops: - ResizeImage: - resize_short: 256 - - CropImage: - size: 224 + size: [224, 224] + return_numpy: False + interpolation: bilinear + backend: cv2 - NormalizeImage: - scale: 0.00392157 + scale: 1.0/255.0 mean: [0.485, 0.456, 0.406] std: [0.229, 0.224, 0.225] - order: "" + order: hwc - ToCHWImage: RecPostProcess: null diff --git a/deploy/paddleserving/recognition/test_cpp_serving_client.py b/deploy/paddleserving/recognition/test_cpp_serving_client.py index f0193e25e7a899d5833b0ccf54961f8fe8f4a04d..0a51f1e02df021066a1ba474b076bcd82baa9851 100644 --- a/deploy/paddleserving/recognition/test_cpp_serving_client.py +++ b/deploy/paddleserving/recognition/test_cpp_serving_client.py @@ -113,7 +113,6 @@ if __name__ == "__main__": batch=False) # add retrieval procedure - print(fetch_map.keys()) det_boxes = fetch_map["boxes"] searcher, id_map = init_index(index_dir) results = postprocess(fetch_map, feature_normalize, det_boxes, searcher, diff --git a/docs/zh_CN/image_recognition_pipeline/feature_extraction.md b/docs/zh_CN/image_recognition_pipeline/feature_extraction.md index 4bbbc1261bc299af323b68839aea406de03c0d73..0ae9f8bf913831440cdf6e5e51bc59dd357e9a15 100644 --- a/docs/zh_CN/image_recognition_pipeline/feature_extraction.md +++ b/docs/zh_CN/image_recognition_pipeline/feature_extraction.md @@ -252,12 +252,12 @@ python3.7 python/predict_rec.py \ 得到的特征输出格式如下所示: ```log -wangzai.jpg: [-4.72979844e-02 3.40038240e-02 -4.06982675e-02 2.46225717e-03 - 9.67078656e-03 2.70162839e-02 -8.85589980e-03 -4.71983254e-02 - 6.18615076e-02 1.38509814e-02 -1.11342799e-02 6.73768669e-02 - -1.03065455e-02 -4.88462113e-02 8.46387446e-03 1.57074817e-02 +wangzai.jpg: [-7.82453567e-02 2.55877394e-02 -3.66694555e-02 1.34572461e-02 + 4.39076796e-02 -2.34078392e-02 -9.49947070e-03 1.28221214e-02 + 5.53947650e-02 1.01355985e-02 -1.06436480e-02 4.97181974e-02 + -2.21862812e-02 -1.75557341e-02 1.55848479e-02 -3.33278324e-03 ... - -3.14170569e-02 7.35917836e-02 -3.09373233e-02 -2.31755469e-02] + -3.40284109e-02 8.35561901e-02 2.10910216e-02 -3.27066667e-02] ``` 在实际使用过程中,仅仅得到特征可能并不能满足业务需求。如果想进一步通过特征检索来进行图像识别,可以参照文档 [向量检索](./vector_search.md)。 diff --git a/test_tipc/README.md b/test_tipc/README.md index 5a3426bcbbb98f7f4f891cd0b72119939f4769a2..e110f475ade01c64c72d6bbbdd1df816e0cb5d13 100644 --- a/test_tipc/README.md +++ b/test_tipc/README.md @@ -110,7 +110,6 @@ bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/MobileNetV3/Mo - [test_train_pact_inference_python 使用](docs/test_train_pact_inference_python.md):测试基于Python的模型PACT在线量化等基本功能。 - [test_train_ptq_inference_python 使用](docs/test_train_ptq_inference_python.md):测试基于Python的模型KL离线量化等基本功能。 - [test_inference_cpp 使用](docs/test_inference_cpp.md) :测试基于C++的模型推理。 -- [test_serving 使用](docs/test_serving.md) :测试基于Paddle Serving的服务化部署功能。 - [test_lite_arm_cpu_cpp 使用](docs/test_lite_arm_cpu_cpp.md): 测试基于Paddle-Lite的ARM CPU端c++预测部署功能. - [test_paddle2onnx 使用](docs/test_paddle2onnx.md):测试Paddle2ONNX的模型转化功能,并验证正确性。 - [test_serving_infer_python 使用](docs/test_serving_infer_python.md):测试python serving功能。 diff --git a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_custom_sampler.txt b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_custom_sampler.txt index c1dbc89617fba27a3abfc80d9eca461f4aee212c..f3c78bbd2b5321260969acc9ea1a79fa6f39b1cf 100644 --- a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_custom_sampler.txt +++ b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_custom_sampler.txt @@ -13,14 +13,14 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:norm_train -norm_train:tools/train.py -c ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5.yaml -o DataLoader.Train.sampler.name="PKSampler" -o DataLoader.Train.sampler.sample_per_id=2 +norm_train:tools/train.py -c ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5.yaml -o DataLoader.Train.sampler.name="PKSampler" -o DataLoader.Train.sampler.sample_per_id=2 pact_train:null fpgm_train:null distill_train:null null:null null:null ## -===========================eval_params=========================== +===========================eval_params=========================== eval:null null:null ## diff --git a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_infer_python.txt b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_infer_python.txt index ff3bd088ddf22e20ca2b40aee1175c07961017f3..bdefd9476489bc61b870beb93a056dc2416d5213 100644 --- a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_infer_python.txt +++ b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_infer_python.txt @@ -20,7 +20,7 @@ distill_train:null null:null null:null ## -===========================eval_params=========================== +===========================eval_params=========================== eval:tools/eval.py -c ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5.yaml null:null ## @@ -37,7 +37,7 @@ pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/r infer_model:../inference/ infer_export:True infer_quant:Fasle -inference:python/predict_rec.py -c configs/inference_rec.yaml +inference:python/predict_rec.py -c configs/inference_rec.yaml -o Global.rec_inference_model_dir="./models/general_PPLCNet_x2_5_lite_v1.0_infer" -o Global.use_gpu:True|False -o Global.enable_mkldnn:False -o Global.cpu_num_threads:1 diff --git a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt index fdcc052e9bd53af443095586ab858af0049bd75b..2c7788ac6e31424061309e2e45116ea27fedf9a1 100644 --- a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt @@ -37,7 +37,7 @@ pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/r infer_model:../inference/ infer_export:True infer_quant:Fasle -inference:python/predict_rec.py -c configs/inference_rec.yaml +inference:python/predict_rec.py -c configs/inference_rec.yaml -o Global.rec_inference_model_dir="./models/general_PPLCNet_x2_5_lite_v1.0_infer" -o Global.use_gpu:True|False -o Global.enable_mkldnn:False -o Global.cpu_num_threads:1 diff --git a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index c433838faa65875fdb48679ae7fca47466a2f5c9..b2510e269d8af8018dac9745190f66d3a80615e7 100644 --- a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -37,7 +37,7 @@ pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/r infer_model:../inference/ infer_export:True infer_quant:Fasle -inference:python/predict_rec.py -c configs/inference_rec.yaml +inference:python/predict_rec.py -c configs/inference_rec.yaml -o Global.rec_inference_model_dir="./models/general_PPLCNet_x2_5_lite_v1.0_infer" -o Global.use_gpu:True|False -o Global.enable_mkldnn:False -o Global.cpu_num_threads:6 diff --git a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_multicard_eval.txt b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_multicard_eval.txt index 165cfa9fb60d9d578ccfe7a9bd0fba5548bed3be..a4ef01b886183e9c18f54d90ab01ad528c908116 100644 --- a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_multicard_eval.txt +++ b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_multicard_eval.txt @@ -20,7 +20,7 @@ distill_train:null null:null null:null ## -===========================eval_params=========================== +===========================eval_params=========================== eval:null null:null ## diff --git a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_no_eval.txt b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_no_eval.txt index 1e167518433c4cfe42a931f4314361406941a87f..ba8ef39caaf7140aac059ae2b8a1aa9c962c301f 100644 --- a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_no_eval.txt +++ b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_no_eval.txt @@ -20,7 +20,7 @@ distill_train:null null:null null:null ## -===========================eval_params=========================== +===========================eval_params=========================== eval:null null:null ## diff --git a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_pact_infer_python.txt b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_pact_infer_python.txt index f557b258f42d7a793825e5a237de960a8c2e1fd8..5e299948b7876381371668f50ed1cbc9b47a3a93 100644 --- a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_pact_infer_python.txt +++ b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_pact_infer_python.txt @@ -37,7 +37,7 @@ pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/r infer_model:../inference/ infer_export:True infer_quant:Fasle -inference:python/predict_rec.py -c configs/inference_rec.yaml +inference:python/predict_rec.py -c configs/inference_rec.yaml -o Global.rec_inference_model_dir="./models/general_PPLCNet_x2_5_lite_v1.0_infer" -o Global.use_gpu:True|False -o Global.enable_mkldnn:False -o Global.cpu_num_threads:1 diff --git a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_ptq_infer_python.txt b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_ptq_infer_python.txt index d5863d8c06a2647b2c52bee77fac02368023f52c..925ee91757acb4f48458933fa2b9163dc9c4557a 100644 --- a/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_ptq_infer_python.txt +++ b/test_tipc/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_ptq_infer_python.txt @@ -20,7 +20,7 @@ distill_train:null null:null null:null ## -===========================eval_params=========================== +===========================eval_params=========================== eval:tools/eval.py -c ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5.yaml null:null ## @@ -37,7 +37,7 @@ pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/r infer_model:./general_PPLCNet_x2_5_lite_v1.0_infer/ infer_export:True infer_quant:Fasle -inference:python/predict_rec.py -c configs/inference_rec.yaml +inference:python/predict_rec.py -c configs/inference_rec.yaml -o Global.rec_inference_model_dir="./models/general_PPLCNet_x2_5_lite_v1.0_infer" -o Global.use_gpu:True|False -o Global.enable_mkldnn:False -o Global.cpu_num_threads:1 diff --git a/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt new file mode 100644 index 0000000000000000000000000000000000000000..f22f55a52f869fe7811c7722da5bc63c8111120f --- /dev/null +++ b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt @@ -0,0 +1,16 @@ +===========================paddle2onnx_params=========================== +model_name:GeneralRecognitionV2_PPLCNetV2_base +python:python3.7 +2onnx: paddle2onnx +--model_dir:./deploy/models/general_PPLCNetV2_base_pretrained_v1.0_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--save_file:./deploy/models/general_PPLCNetV2_base_pretrained_v1.0_infer/inference.onnx +--opset_version:10 +--enable_onnx_checker:True +inference_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/PP-ShiTuV2/general_PPLCNetV2_base_pretrained_v1.0_infer.tar +inference:./python/predict_rec.py +Global.use_onnx:True +Global.rec_inference_model_dir:./models/general_PPLCNetV2_base_pretrained_v1.0_infer +Global.use_gpu:False +-c:configs/inference_rec.yaml \ No newline at end of file diff --git a/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_infer_python.txt b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_infer_python.txt new file mode 100644 index 0000000000000000000000000000000000000000..81b59edbf4e18ac29579c4b45464d1f8a85a2024 --- /dev/null +++ b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_infer_python.txt @@ -0,0 +1,60 @@ +===========================train_params=========================== +model_name:GeneralRecognitionV2_PPLCNetV2_base +python:python3.7 +gpu_list:0|0,1 +-o Global.device:gpu +-o Global.auto_cast:null +-o Global.epochs:lite_train_lite_infer=2|whole_train_whole_infer=120 +-o Global.output_dir:./output/ +-o DataLoader.Train.sampler.batch_size:8 +-o Global.pretrained_model:null +train_model_name:latest +train_infer_img_dir:./dataset/ILSVRC2012/val +null:null +## +trainer:norm_train +norm_train:tools/train.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o Global.eval_during_train=False -o Global.save_interval=2 -o DataLoader.Train.dataset.cls_label_path=./dataset/train_reg_all_data.txt -o DataLoader.Train.loader.sampler.batch_size=8 +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:tools/eval.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml +null:null +## +===========================infer_params========================== +-o Global.save_inference_dir:./inference +-o Global.pretrained_model: +norm_export:tools/export_model.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml +quant_export:null +fpgm_export:null +distill_export:null +kl_quant:null +export2:null +pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/pretrain/PPShiTuV2/general_PPLCNetV2_base_pretrained_v1.0.pdparams +infer_model:../inference/ +infer_export:True +infer_quant:Fasle +inference:python/predict_rec.py -c configs/inference_rec.yaml +-o Global.use_gpu:True|False +-o Global.enable_mkldnn:False +-o Global.cpu_num_threads:1 +-o Global.batch_size:1 +-o Global.use_tensorrt:False +-o Global.use_fp16:False +-o Global.rec_inference_model_dir:../inference +-o Global.infer_imgs:../dataset/Aliproduct/demo_test/ +-o Global.save_log_path:null +-o Global.benchmark:False +null:null +null:null +===========================train_benchmark_params========================== +batch_size:256 +fp_items:fp32|fp16 +epoch:1 +--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile +flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096 +===========================infer_benchmark_params========================== +random_infer_input:[{float32,[3,224,224]}] \ No newline at end of file diff --git a/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt new file mode 100644 index 0000000000000000000000000000000000000000..f1f32751d6ee296c341c0e8382e5fdae2b9335bb --- /dev/null +++ b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt @@ -0,0 +1,54 @@ +===========================train_params=========================== +model_name:GeneralRecognition_PPLCNet_x2_5 +python:python3.7 +gpu_list:192.168.0.1,192.168.0.2;0,1 +-o Global.device:gpu +-o Global.auto_cast:null +-o Global.epochs:lite_train_lite_infer=2|whole_train_whole_infer=120 +-o Global.output_dir:./output/ +-o DataLoader.Train.sampler.batch_size:8 +-o Global.pretrained_model:null +train_model_name:latest +train_infer_img_dir:./dataset/ILSVRC2012/val +null:null +## +trainer:norm_train +norm_train:tools/train.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o Global.eval_during_train=False -o Global.save_interval=2 -o DataLoader.Train.dataset.cls_label_path=./dataset/train_reg_all_data.txt -o DataLoader.Train.loader.sampler.batch_size=8 +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:tools/eval.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml +null:null +## +===========================infer_params========================== +-o Global.save_inference_dir:./inference +-o Global.pretrained_model: +norm_export:tools/export_model.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml +quant_export:null +fpgm_export:null +distill_export:null +kl_quant:null +export2:null +pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/pretrain/PPShiTuV2/general_PPLCNetV2_base_pretrained_v1.0.pdparams +infer_model:../inference/ +infer_export:True +infer_quant:Fasle +inference:python/predict_rec.py -c configs/inference_rec.yaml +-o Global.use_gpu:True|False +-o Global.enable_mkldnn:False +-o Global.cpu_num_threads:1 +-o Global.batch_size:1 +-o Global.use_tensorrt:False +-o Global.use_fp16:False +-o Global.rec_inference_model_dir:../inference +-o Global.infer_imgs:../dataset/Aliproduct/demo_test/ +-o Global.save_log_path:null +-o Global.benchmark:False +null:null +null:null +===========================infer_benchmark_params========================== +random_infer_input:[{float32,[3,224,224]}] \ No newline at end of file diff --git a/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt new file mode 100644 index 0000000000000000000000000000000000000000..6e436de4063ac5e4917815b639ae5684fce2831b --- /dev/null +++ b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -0,0 +1,52 @@ +===========================train_params=========================== +model_name:GeneralRecognitionV2_PPLCNetV2_base +python:python3.7 +gpu_list:0|0,1 +-o Global.device:gpu +-o Global.auto_cast:null +-o Global.epochs:lite_train_lite_infer=2|whole_train_whole_infer=100 +-o Global.output_dir:./output/ +-o DataLoader.Train.sampler.batch_size:8 +-o Global.pretrained_model:null +train_model_name:latest +train_infer_img_dir:./dataset/ILSVRC2012/val +null:null +## +trainer:amp_train +amp_train:tools/train.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True -o Global.eval_during_train=False -o DataLoader.Train.dataset.cls_label_path=./dataset/train_reg_all_data.txt -o DataLoader.Train.loader.sampler.batch_size=8 +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:tools/eval.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml +null:null +## +===========================infer_params========================== +-o Global.save_inference_dir:./inference +-o Global.pretrained_model: +norm_export:tools/export_model.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml +quant_export:null +fpgm_export:null +distill_export:null +kl_quant:null +export2:null +pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/pretrain/PPShiTuV2/general_PPLCNetV2_base_pretrained_v1.0.pdparams +infer_model:../inference/ +infer_export:True +infer_quant:Fasle +inference:python/predict_rec.py -c configs/inference_rec.yaml +-o Global.use_gpu:True|False +-o Global.enable_mkldnn:False +-o Global.cpu_num_threads:6 +-o Global.batch_size:1 +-o Global.use_tensorrt:False +-o Global.use_fp16:False +-o Global.rec_inference_model_dir:../inference +-o Global.infer_imgs:../dataset/Aliproduct/demo_test/ +-o Global.save_log_path:null +-o Global.benchmark:False +null:null +null:null diff --git a/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_pact_infer_python.txt b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_pact_infer_python.txt new file mode 100644 index 0000000000000000000000000000000000000000..68e4c4ac8ec00cb688fefa7d0a0d27bab9fedbe1 --- /dev/null +++ b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_pact_infer_python.txt @@ -0,0 +1,54 @@ +===========================train_params=========================== +model_name:GeneralRecognitionV2_PPLCNetV2_base +python:python3.7 +gpu_list:0 +-o Global.device:gpu +-o Global.auto_cast:null +-o Global.epochs:lite_train_lite_infer=2|whole_train_whole_infer=100 +-o Global.output_dir:./output/ +-o DataLoader.Train.sampler.batch_size:8 +-o Global.pretrained_model:null +train_model_name:latest +train_infer_img_dir:./dataset/ILSVRC2012/val +null:null +## +trainer:pact_train +norm_train:null +pact_train:tools/train.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o Slim.quant.name=pact -o Optimizer.lr.learning_rate=0.006 -o Global.pretrained_model="pretrained_model/general_PPLCNetV2_base_pretrained_v1.0" -o DataLoader.Train.dataset.cls_label_path=./dataset/train_reg_all_data.txt -o AMP=None -o DataLoader.Train.sampler.batch_size=8 +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:tools/eval.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml -o Slim.quant.name=pact +null:null +## +===========================infer_params========================== +-o Global.save_inference_dir:./inference +-o Global.pretrained_model: +norm_export:null +quant_export:tools/export_model.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml -o Slim.quant.name=pact +fpgm_export:null +distill_export:null +kl_quant:null +export2:null +pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/pretrain/PPShiTuV2/general_PPLCNetV2_base_pretrained_v1.0.pdparams +infer_model:../inference/ +infer_export:True +infer_quant:Fasle +inference:python/predict_rec.py -c configs/inference_rec.yaml +-o Global.use_gpu:True|False +-o Global.enable_mkldnn:False +-o Global.cpu_num_threads:1 +-o Global.batch_size:1 +-o Global.use_tensorrt:False +-o Global.use_fp16:False +-o Global.rec_inference_model_dir:../inference +-o Global.infer_imgs:../dataset/Aliproduct/demo_test/ +-o Global.save_log_path:null +-o Global.benchmark:True +null:null +null:null +===========================infer_benchmark_params========================== +random_infer_input:[{float32,[3,224,224]}] \ No newline at end of file diff --git a/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_ptq_infer_python.txt b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_ptq_infer_python.txt new file mode 100644 index 0000000000000000000000000000000000000000..d82e871fb30aa70093b1f91aab3e0327fd16eedf --- /dev/null +++ b/test_tipc/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base_train_ptq_infer_python.txt @@ -0,0 +1,54 @@ +===========================train_params=========================== +model_name:GeneralRecognitionV2_PPLCNetV2_base +python:python3.7 +gpu_list:0 +-o Global.device:gpu +-o Global.auto_cast:null +-o Global.epochs:lite_train_lite_infer=2|whole_train_whole_infer=100 +-o Global.output_dir:./output/ +-o DataLoader.Train.sampler.batch_size:8 +-o Global.pretrained_model:null +train_model_name:latest +train_infer_img_dir:./dataset/ILSVRC2012/val +null:null +## +trainer:pact_train +norm_train:null +pact_train:tools/train.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:tools/eval.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml +null:null +## +===========================infer_params========================== +-o Global.save_inference_dir:./inference +-o Global.pretrained_model: +norm_export:null +quant_export:tools/export_model.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml +fpgm_export:null +distill_export:null +kl_quant:deploy/slim/quant_post_static.py -c ppcls/configs/GeneralRecognitionV2/GeneralRecognitionV2_PPLCNetV2_base.yaml -o Global.save_inference_dir=./general_PPLCNetV2_base_pretrained_v1.0_infer +export2:null +pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/PP-ShiTuV2/general_PPLCNetV2_base_pretrained_v1.0_infer.tar +infer_model:./general_PPLCNetV2_base_pretrained_v1.0_infer +infer_export:True +infer_quant:Fasle +inference:python/predict_rec.py -c configs/inference_rec.yaml +-o Global.use_gpu:True|False +-o Global.enable_mkldnn:False +-o Global.cpu_num_threads:1 +-o Global.batch_size:1 +-o Global.use_tensorrt:False +-o Global.use_fp16:False +-o Global.rec_inference_model_dir:../inference +-o Global.infer_imgs:../dataset/Aliproduct/demo_test/ +-o Global.save_log_path:null +-o Global.benchmark:False +null:null +null:null +===========================infer_benchmark_params========================== +random_infer_input:[{float32,[3,224,224]}] \ No newline at end of file diff --git a/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt new file mode 100644 index 0000000000000000000000000000000000000000..52a88a3183e1dde7e75177160e868c2617dc75cb --- /dev/null +++ b/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -0,0 +1,19 @@ +===========================cpp_infer_params=========================== +model_name:PPShiTuV2 +cpp_infer_type:shitu +feature_inference_model_dir:./general_PPLCNetV2_base_pretrained_v1.0_infer/ +det_inference_model_dir:./picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer/ +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/PP-ShiTuV2/general_PPLCNetV2_base_pretrained_v1.0_infer.tar +det_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer.tar +infer_quant:False +inference_cmd:./deploy/cpp_shitu/build/pp_shitu -c inference_drink.yaml +use_gpu:True|False +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +data_dir:./dataset/drink_dataset_v2.0 +benchmark:True +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py +transform_index_cmd:python3.7 deploy/cpp_shitu/tools/transform_id_map.py -c inference_drink.yaml diff --git a/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_serving_cpp_linux_gpu_cpu.txt b/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_serving_cpp_linux_gpu_cpu.txt new file mode 100644 index 0000000000000000000000000000000000000000..bc0c086b5c7c713392bbb09a34994a631035dc26 --- /dev/null +++ b/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_serving_cpp_linux_gpu_cpu.txt @@ -0,0 +1,18 @@ +===========================serving_params=========================== +model_name:PPShiTuV2 +python:python3.7 +cls_inference_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/PP-ShiTuV2/general_PPLCNetV2_base_pretrained_v1.0_infer.tar +det_inference_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer.tar +trans_model:-m paddle_serving_client.convert +--dirname:./models/general_PPLCNetV2_base_pretrained_v1.0_infer/ +--dirname:./models/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--serving_server:./models/general_PPLCNetV2_base_pretrained_v1.0_serving/ +--serving_client:./models/general_PPLCNetV2_base_pretrained_v1.0_client/ +--serving_server:./models/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_serving/ +--serving_client:./models/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_client/ +serving_dir:./paddleserving/recognition +web_service:null +--use_gpu:0|null +pipline:test_cpp_serving_client.py diff --git a/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt b/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt new file mode 100644 index 0000000000000000000000000000000000000000..1c08a4cf3b21a9edbb2847b6ca4589f50136b60f --- /dev/null +++ b/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt @@ -0,0 +1,18 @@ +===========================serving_params=========================== +model_name:PPShiTuV2 +python:python3.7 +cls_inference_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/PP-ShiTuV2/general_PPLCNetV2_base_pretrained_v1.0_infer.tar +det_inference_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer.tar +trans_model:-m paddle_serving_client.convert +--dirname:./models/general_PPLCNetV2_base_pretrained_v1.0_infer/ +--dirname:./models/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--serving_server:./models/general_PPLCNetV2_base_pretrained_v1.0_serving/ +--serving_client:./models/general_PPLCNetV2_base_pretrained_v1.0_client/ +--serving_server:./models/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_serving/ +--serving_client:./models/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_client/ +serving_dir:./paddleserving/recognition +web_service:recognition_web_service.py +--use_gpu:0|null +pipline:pipeline_http_client.py diff --git a/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_mainbody_det_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt b/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_mainbody_det_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt new file mode 100644 index 0000000000000000000000000000000000000000..bfd24bb4106245d7b279d0e7c07ffbc39f28fe83 --- /dev/null +++ b/test_tipc/configs/PP-ShiTuV2/PPShiTuV2_mainbody_det_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt @@ -0,0 +1,16 @@ +===========================paddle2onnx_params=========================== +model_name:PP-ShiTu_mainbody_det +python:python3.7 +2onnx: paddle2onnx +--model_dir:./deploy/models/picodet_lcnet_x2_5_640_mainbody_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--save_file:./deploy/models/picodet_lcnet_x2_5_640_mainbody_infer/inference.onnx +--opset_version:11 +--enable_onnx_checker:True +inference_model_url:https://paddledet.bj.bcebos.com/models/picodet_lcnet_x2_5_640_mainbody_infer.tar +inference:null +Global.use_onnx:null +Global.inference_model_dir:null +Global.use_gpu:null +-c:null \ No newline at end of file diff --git a/test_tipc/docs/test_inference_cpp.md b/test_tipc/docs/test_inference_cpp.md index 256e6a5f4d10d2e64e71778fe43f84c1784b3000..86a486ae93ca9f6664f9db708406e840609e2948 100644 --- a/test_tipc/docs/test_inference_cpp.md +++ b/test_tipc/docs/test_inference_cpp.md @@ -12,6 +12,7 @@ Linux GPU/CPU C++ 推理功能测试的主程序为`test_inference_cpp.sh`,可 | MobileNetV3 | MobileNetV3_large_x1_0_KL | 支持 | 支持 | | MobileNetV3 | MobileNetV3_large_x1_0_PACT | 支持 | 支持 | | PP-ShiTu | PPShiTu_general_rec、PPShiTu_mainbody_det | 支持 | 支持 | +| PP-ShiTuV2 | PPShiTuV2_general_rec、PPShiTu_mainbody_det | 支持 | 支持 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5_KL | 支持 | 支持 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5_PACT | 支持 | 支持 | | PPHGNet | PPHGNet_small | 支持 | 支持 | diff --git a/test_tipc/docs/test_serving_infer_cpp.md b/test_tipc/docs/test_serving_infer_cpp.md index 3ddd0c253b9d596697da8108e9cf563a21bf0cba..d1dc02ac375a46a888a66ed240304f241dee25cb 100644 --- a/test_tipc/docs/test_serving_infer_cpp.md +++ b/test_tipc/docs/test_serving_infer_cpp.md @@ -15,6 +15,7 @@ Linux GPU/CPU C++ 服务化部署测试的主程序为`test_serving_infer_cpp.sh | PP-ShiTu | PPShiTu_general_rec、PPShiTu_mainbody_det | 支持 | 支持 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5_KL | 支持 | 支持 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5_PACT | 支持 | 支持 | +| PP-ShiTuV2 | PPShiTuV2_general_rec、PPShiTu_mainbody_det | 支持 | 支持 | | PPHGNet | PPHGNet_small | 支持 | 支持 | | PPHGNet | PPHGNet_small_KL | 支持 | 支持 | | PPHGNet | PPHGNet_small_PACT | 支持 | 支持 | diff --git a/test_tipc/docs/test_serving_infer_python.md b/test_tipc/docs/test_serving_infer_python.md index 9bd9dc4c2d65f2d55a0335d012fdef37b7097f54..6314031c6963662a0df2fd81dca57fd86f1ae9b0 100644 --- a/test_tipc/docs/test_serving_infer_python.md +++ b/test_tipc/docs/test_serving_infer_python.md @@ -15,6 +15,7 @@ Linux GPU/CPU PYTHON 服务化部署测试的主程序为`test_serving_infer_pyt | PP-ShiTu | PPShiTu_general_rec、PPShiTu_mainbody_det | 支持 | 支持 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5_KL | 支持 | 支持 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5_PACT | 支持 | 支持 | +| PP-ShiTuV2 | PPShiTuV2_general_rec、PPShiTu_mainbody_det | 支持 | 支持 | | PPHGNet | PPHGNet_small | 支持 | 支持 | | PPHGNet | PPHGNet_small_KL | 支持 | 支持 | | PPHGNet | PPHGNet_small_PACT | 支持 | 支持 | diff --git a/test_tipc/docs/test_train_amp_inference_python.md b/test_tipc/docs/test_train_amp_inference_python.md index a6a5897d3f1afeab333ad40d7b8b8f926b92c68e..b9fd6cb68981938120b2b2e610a517cc47592f61 100644 --- a/test_tipc/docs/test_train_amp_inference_python.md +++ b/test_tipc/docs/test_train_amp_inference_python.md @@ -10,6 +10,7 @@ Linux GPU/CPU 混合精度训练推理测试的主程序为`test_train_inference | :-------------: | :-------------------------------------: | :----------: | :----------: | | MobileNetV3 | MobileNetV3_large_x1_0 | 混合精度训练 | 混合精度训练 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5 | 混合精度训练 | 混合精度训练 | +| PP-ShiTuV2 | GeneralRecognitionV2_PPLCNetV2_base | 混合精度训练 | 混合精度训练 | | PPHGNet | PPHGNet_small | 混合精度训练 | 混合精度训练 | | PPHGNet | PPHGNet_tiny | 混合精度训练 | 混合精度训练 | | PPLCNet | PPLCNet_x0_25 | 混合精度训练 | 混合精度训练 | @@ -31,6 +32,7 @@ Linux GPU/CPU 混合精度训练推理测试的主程序为`test_train_inference | :-------------: | :-------------------------------------: | :--------: | :--------: | :-------: | | MobileNetV3 | MobileNetV3_large_x1_0 | 支持 | 支持 | 1 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5 | 支持 | 支持 | 1 | +| PP-ShiTuV2 | GeneralRecognitionV2_PPLCNetV2_base | 支持 | 支持 | 1 | | PPHGNet | PPHGNet_small | 支持 | 支持 | 1 | | PPHGNet | PPHGNet_tiny | 支持 | 支持 | 1 | | PPLCNet | PPLCNet_x0_25 | 支持 | 支持 | 1 | diff --git a/test_tipc/docs/test_train_pact_inference_python.md b/test_tipc/docs/test_train_pact_inference_python.md index 6aeecad78a27172ea54aa2bbe318f68a5d0ee188..795c70c6447be933674b603130f93aed98c27e08 100644 --- a/test_tipc/docs/test_train_pact_inference_python.md +++ b/test_tipc/docs/test_train_pact_inference_python.md @@ -10,6 +10,7 @@ Linux GPU/CPU PACT量化训练推理测试的主程序为`test_train_inference_p | :-------------: | :-------------------------------------: | :----------: | | MobileNetV3 | MobileNetV3_large_x1_0 | PACT量化训练 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5 | PACT量化训练 | +| PP-ShiTuV2 | GeneralRecognitionV2_PPLCNetV2_base | PACT量化训练 | | PPHGNet | PPHGNet_small | PACT量化训练 | | PPHGNet | PPHGNet_tiny | PACT量化训练 | | PPLCNet | PPLCNet_x0_25 | PACT量化训练 | @@ -31,6 +32,7 @@ Linux GPU/CPU PACT量化训练推理测试的主程序为`test_train_inference_p | :-------------: | :-------------------------------------: | :--------: | :--------: | :-------: | | MobileNetV3 | MobileNetV3_large_x1_0 | 支持 | 支持 | 1 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5 | 支持 | 支持 | 1 | +| PP-ShiTuV2 | GeneralRecognitionV2_PPLCNetV2_base | 支持 | 支持 | 1 | | PPHGNet | PPHGNet_small | 支持 | 支持 | 1 | | PPHGNet | PPHGNet_tiny | 支持 | 支持 | 1 | | PPLCNet | PPLCNet_x0_25 | 支持 | 支持 | 1 | diff --git a/test_tipc/docs/test_train_ptq_inference_python.md b/test_tipc/docs/test_train_ptq_inference_python.md index 29d5b9f59b31d96dd5fe2b325853fee911a87c97..18eddd127934fc63d82140c196913248572ae321 100644 --- a/test_tipc/docs/test_train_ptq_inference_python.md +++ b/test_tipc/docs/test_train_ptq_inference_python.md @@ -10,6 +10,7 @@ Linux GPU/CPU KL离线量化推理测试的主程序为`test_ptq_inference_pytho | :-------------: | :-------------------------------------: | :----------: | | MobileNetV3 | MobileNetV3_large_x1_0 | KL离线量化 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5 | KL离线量化 | +| PP-ShiTuV2 | GeneralRecognitionV2_PPLCNetV2_base | KL离线量化 | | PPHGNet | PPHGNet_small | KL离线量化 | | PPHGNet | PPHGNet_tiny | KL离线量化 | | PPLCNet | PPLCNet_x0_25 | KL离线量化 | @@ -31,6 +32,7 @@ Linux GPU/CPU KL离线量化推理测试的主程序为`test_ptq_inference_pytho | :-------------: | :-------------------------------------: | :----------: | | MobileNetV3 | MobileNetV3_large_x1_0 | KL离线量化 | | PP-ShiTu | GeneralRecognition_PPLCNet_x2_5 | KL离线量化 | +| PP-ShiTuV2 | GeneralRecognitionV2_PPLCNetV2_base | KL离线量化 | | PPHGNet | PPHGNet_small | KL离线量化 | | PPHGNet | PPHGNet_tiny | KL离线量化 | | PPLCNet | PPLCNet_x0_25 | KL离线量化 | diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index ad4c5fc214cb16208514c218f55feebb22685f6d..db8f3925879fbf8781af59ef6ec0d17b3b699d81 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -43,7 +43,8 @@ function func_get_url_file_name() { model_name=$(func_parser_value "${lines[1]}") # install paddleclas whl -python setup.py install +python_name=$(func_parser_value "${lines[2]}") +${python_name} setup.py install if [[ ${MODE} = "cpp_infer" ]]; then if [ -d "./deploy/cpp/opencv-3.4.7/opencv3/" ] && [ $(md5sum ./deploy/cpp/opencv-3.4.7.tar.gz | awk -F ' ' '{print $1}') = "faa2b5950f8bee3f03118e600c74746a" ]; then @@ -142,6 +143,8 @@ if [[ ${MODE} = "cpp_infer" ]]; then cd dataset wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/data/drink_dataset_v1.0.tar tar -xf drink_dataset_v1.0.tar + wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/data/drink_dataset_v2.0.tar + tar -xf drink_dataset_v2.0.tar else echo "Wrong cpp type in config file in line 3. only support cls, shitu" fi @@ -170,8 +173,9 @@ if [[ $model_name == *ShiTu* ]]; then ln -s demo_test.txt val_list.txt cd ../../ eval "wget -nc $model_url_value --no-check-certificate" - mv general_PPLCNet_x2_5_pretrained_v1.0.pdparams GeneralRecognition_PPLCNet_x2_5_pretrained.pdparams - exit 0 + if [[ -d "./general_PPLCNet_x2_5_pretrained_v1.0.pdparams" ]]; then + mv general_PPLCNet_x2_5_pretrained_v1.0.pdparams GeneralRecognition_PPLCNet_x2_5_pretrained.pdparams + fi fi if [[ $FILENAME == *use_dali* ]]; then @@ -243,12 +247,12 @@ elif [[ ${MODE} = "whole_infer" ]]; then cd ../../ fi # download inference or pretrained model - eval "wget -nc $model_url_value" + eval "wget -nc ${model_url_value}" if [[ ${model_url_value} =~ ".tar" ]]; then tar_name=$(func_get_url_file_name "${model_url_value}") - echo $tar_name - rm -rf {tar_name} - tar xf ${tar_name} + echo ${tar_name} + eval "tar -xf ${tar_name}" + rm -f ${tar_name} fi if [[ $model_name == "SwinTransformer_large_patch4_window7_224" || $model_name == "SwinTransformer_large_patch4_window12_384" ]]; then cmd="mv ${model_name}_22kto1k_pretrained.pdparams ${model_name}_pretrained.pdparams" @@ -278,7 +282,7 @@ fi if [[ ${MODE} = "serving_infer" ]]; then # prepare serving env python_name=$(func_parser_value "${lines[2]}") - if [[ ${model_name} = "PPShiTu" ]]; then + if [[ ${model_name} =~ "PPShiTu" ]]; then cls_inference_model_url=$(func_parser_value "${lines[3]}") cls_tar_name=$(func_get_url_file_name "${cls_inference_model_url}") det_inference_model_url=$(func_parser_value "${lines[4]}") @@ -286,6 +290,8 @@ if [[ ${MODE} = "serving_infer" ]]; then cd ./deploy wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/data/drink_dataset_v1.0.tar --no-check-certificate tar -xf drink_dataset_v1.0.tar + wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/data/drink_dataset_v2.0.tar --no-check-certificate + tar -xf drink_dataset_v2.0.tar mkdir models cd models wget -nc ${cls_inference_model_url} && tar xf ${cls_tar_name} @@ -319,6 +325,7 @@ if [[ ${MODE} = "paddle2onnx_infer" ]]; then inference_model_url=$(func_parser_value "${lines[10]}") tar_name=${inference_model_url##*/} + ${python_name} -m pip install onnx ${python_name} -m pip install paddle2onnx ${python_name} -m pip install onnxruntime if [[ ${model_name} =~ "GeneralRecognition" ]]; then @@ -335,14 +342,12 @@ if [[ ${MODE} = "paddle2onnx_infer" ]]; then rm -rf val_list.txt ln -s demo_test.txt val_list.txt cd ../../ - eval "wget -nc $model_url_value --no-check-certificate" - mv general_PPLCNet_x2_5_pretrained_v1.0.pdparams GeneralRecognition_PPLCNet_x2_5_pretrained.pdparams fi cd deploy mkdir models cd models wget -nc ${inference_model_url} - tar xf ${tar_name} + eval "tar -xf ${tar_name}" cd ../../ fi diff --git a/test_tipc/test_serving_infer_cpp.sh b/test_tipc/test_serving_infer_cpp.sh index fdb7ef186bafd9dcd879150188e1f0450ca87211..d9b62ed3dca7de580b09ee62e01a22a983a3d4fc 100644 --- a/test_tipc/test_serving_infer_cpp.sh +++ b/test_tipc/test_serving_infer_cpp.sh @@ -192,9 +192,19 @@ function func_serving_rec(){ det_trans_model_cmd="${python_interp} ${trans_model_py} ${set_dirname} ${set_model_filename} ${set_params_filename} ${set_serving_server} ${set_serving_client}" eval ${det_trans_model_cmd} - cp_prototxt_cmd="cp ./paddleserving/recognition/preprocess/general_PPLCNet_x2_5_lite_v1.0_serving/*.prototxt ${cls_serving_server_value}" + OLD_IFS="${IFS}" + IFS='/' + tmp_arr=($cls_serving_server_value) + lastIndex=$((${#tmp_arr[@]}-1)) + cls_serving_server_dirname="${tmp_arr[lastIndex]}" + tmp_arr=($cls_serving_client_value) + lastIndex=$((${#tmp_arr[@]}-1)) + cls_serving_client_dirname="${tmp_arr[lastIndex]}" + IFS="${OLD_IFS}" + + cp_prototxt_cmd="cp ./paddleserving/recognition/preprocess/${cls_serving_server_dirname}/*.prototxt ${cls_serving_server_value}" eval ${cp_prototxt_cmd} - cp_prototxt_cmd="cp ./paddleserving/recognition/preprocess/general_PPLCNet_x2_5_lite_v1.0_client/*.prototxt ${cls_serving_client_value}" + cp_prototxt_cmd="cp ./paddleserving/recognition/preprocess/${cls_serving_client_dirname}/*.prototxt ${cls_serving_client_value}" eval ${cp_prototxt_cmd} cp_prototxt_cmd="cp ./paddleserving/recognition/preprocess/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_client/*.prototxt ${det_serving_client_value}" eval ${cp_prototxt_cmd} diff --git a/test_tipc/test_serving_infer_python.sh b/test_tipc/test_serving_infer_python.sh index 050c3c89c9a454eb7f973f405ded37a3f1df042a..db13afbb2e8bb4b59e64726a647fce87092e0f29 100644 --- a/test_tipc/test_serving_infer_python.sh +++ b/test_tipc/test_serving_infer_python.sh @@ -311,7 +311,7 @@ echo "################### run test ###################" export Count=0 IFS="|" -if [[ ${model_name} = "PPShiTu" ]]; then +if [[ ${model_name} =~ "PPShiTu" ]]; then func_serving_rec else func_serving_cls