diff --git a/test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 7a1f69fb21c693a5e532148e9829d230478ac218..467dd620949c0f23f1fcd7f4679b02f2428db52c 100644 --- a/test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:MobileNetV3_large_x1_0 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/MobileNetV3_large_x1_0_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/MobileNetV3_large_x1_0_infer/inference.pdmodel -cls_params_path:./deploy/models/MobileNetV3_large_x1_0_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PP-ShiTu/PPShiTu_general_rec_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PP-ShiTu/PPShiTu_general_rec_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 7a025e80af56d4dcd53fadf9221bee1c92f68790..7c150d7f8c2425c5ef3a764444f857b0ae242126 100644 --- a/test_tipc/config/PP-ShiTu/PPShiTu_general_rec_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PP-ShiTu/PPShiTu_general_rec_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:general_PPLCNet_x2_5_lite_v1.0 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/general_PPLCNet_x2_5_lite_v1.0_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/general_PPLCNet_x2_5_lite_v1.0_infer/inference.pdmodel -cls_params_path:./deploy/models/general_PPLCNet_x2_5_lite_v1.0_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PP-ShiTu/PPShiTu_mainbody_det_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PP-ShiTu/PPShiTu_mainbody_det_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index b1067c2561c71fb357f0455f32e6a9ceb3129861..145ae988d51fbb597dc499c75a0b7d5466d3fb08 100644 --- a/test_tipc/config/PP-ShiTu/PPShiTu_mainbody_det_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PP-ShiTu/PPShiTu_mainbody_det_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:picodet_PPLCNet_x2_5_mainbody_lite_v1.0 +cpp_infer_type:shitu +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer/inference.pdmodel -cls_params_path:./deploy/models/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPHGNet/PPHGNet_small_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPHGNet/PPHGNet_small_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 566f34530bf99da8ab0f87bd64d0d5e377a008be..d150e7e257ba85b21f520341b2bc2cd4b1286bda 100644 --- a/test_tipc/config/PPHGNet/PPHGNet_small_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPHGNet/PPHGNet_small_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPHGNet_small +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPHGNet_small_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPHGNet_small_infer/inference.pdmodel -cls_params_path:./deploy/models/PPHGNet_small_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPHGNet/PPHGNet_tiny_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPHGNet/PPHGNet_tiny_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 0420a43eb650fc27ff3840d9ea153787243f379c..21f6da3827d99ec7949b47c8810edfc2f0ba889d 100644 --- a/test_tipc/config/PPHGNet/PPHGNet_tiny_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPHGNet/PPHGNet_tiny_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPHGNet_tiny +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPHGNet_tiny_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPHGNet_tiny_infer/inference.pdmodel -cls_params_path:./deploy/models/PPHGNet_tiny_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNet/PPLCNet_x0_25_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x0_25_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 93d6f352e4c4993e31b10952581fb8f1fe496cbe..be366abbbb24b8c803f5f5d4ae32cb4dfc05dfeb 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x0_25_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x0_25_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPLCNet_x0_25 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_25_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x0_25_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x0_25_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNet/PPLCNet_x0_35_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x0_35_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 6f41fe3db1088c73016d87894e7e263d0d825d52..f5ec6b7087e4f557e3fb73cabd8ba1321faf2bfe 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x0_35_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x0_35_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPLCNet_x0_35 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_35_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x0_35_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x0_35_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNet/PPLCNet_x0_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x0_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index e2ae4d14d1281674df7ba7e016ffcafcb303f2e7..2a4d43248eadcc22d12e9109b2445495e353a7d5 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x0_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x0_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPLCNet_x0_5 +cpp_infer_type:cls +cls_inference_model_dir:./deploy/models/PPLCNet_x0_5_infer +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_5_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x0_5_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x0_5_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNet/PPLCNet_x0_75_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x0_75_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index bf377e7a470becc98665136cc9cde0a5470b5aff..b81ad6a7b976884df9437db7ff2a87acd547ed2a 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x0_75_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x0_75_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPLCNet_x0_75 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_75_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x0_75_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x0_75_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNet/PPLCNet_x1_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x1_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index f16deb1b0c1eeab3888799b335ef6f992d3986d3..0216543165dacbfab1169f615d70569bfd70230b 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x1_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x1_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPLCNet_x1_0 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x1_0_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x1_0_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x1_0_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNet/PPLCNet_x1_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x1_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index fc3a2e75b37327975cdd1b110b5d0dafb3bbe5bd..30afa30b1677d44efd4f419dbd2cd80cfda036e0 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x1_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x1_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPLCNet_x1_5 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x1_5_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x1_5_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x1_5_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNet/PPLCNet_x2_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x2_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 52cf9b0d0e6cb135757c4f4e7ac4f60f4e10d374..6d99529d3d38e9c68f77d8a823dd9f75881dc020 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x2_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x2_0_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPLCNet_x2_0 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x2_0_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x2_0_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x2_0_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNet/PPLCNet_x2_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x2_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index b26c82cec352558b6e99e4d715b0de7b70780398..5590f21146a0979177481f26884aa2022d7d50cf 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x2_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x2_5_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:PPLCNet_x2_5 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x2_5_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x2_5_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x2_5_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/PPLCNetV2/PPLCNetV2_base_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/PPLCNetV2/PPLCNetV2_base_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index e2ae4d14d1281674df7ba7e016ffcafcb303f2e7..8d8151bbfbfc2a16e3d59d04877365682c63a924 100644 --- a/test_tipc/config/PPLCNetV2/PPLCNetV2_base_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNetV2/PPLCNetV2_base_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config -model_name:PPLCNet_x0_5 +===========================cpp_infer_params=========================== +model_name:PPLCNetV2_base +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNetV2_base_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/PPLCNet_x0_5_infer/inference.pdmodel -cls_params_path:./deploy/models/PPLCNet_x0_5_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/ResNet/ResNet50_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/ResNet/ResNet50_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 60d9a40436b4e85ddb918c8e3a2939d71ef04f66..3198a4d6e52f29f45140fd700b55d431746ba209 100644 --- a/test_tipc/config/ResNet/ResNet50_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/ResNet/ResNet50_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:ResNet50 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ResNet50_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/ResNet50_infer/inference.pdmodel -cls_params_path:./deploy/models/ResNet50_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/ResNet/ResNet50_vd_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/ResNet/ResNet50_vd_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index dfdd5b7f55f1397a7568c72b260fa3f4c9a916ad..99cfcbab2fabb270cba30efda4abcd844f801105 100644 --- a/test_tipc/config/ResNet/ResNet50_vd_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/ResNet/ResNet50_vd_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:ResNet50_vd +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ResNet50_vd_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/ResNet50_vd_infer/inference.pdmodel -cls_params_path:./deploy/models/ResNet50_vd_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/config/SwinTransformer/SwinTransformer_tiny_patch4_window7_224_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/config/SwinTransformer/SwinTransformer_tiny_patch4_window7_224_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index 8a76d870e8a8ffc39877d658e6a23e58611fa5e9..b750b2d24f353866cd463e9cff6286503777e0ec 100644 --- a/test_tipc/config/SwinTransformer/SwinTransformer_tiny_patch4_window7_224_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/config/SwinTransformer/SwinTransformer_tiny_patch4_window7_224_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -1,12 +1,18 @@ -# model load config +===========================cpp_infer_params=========================== model_name:SwinTransformer_tiny_patch4_window7_224 +cpp_infer_type:cls +cls_inference_model_dir:./inference/ +det_inference_model_dir: +cls_inference_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/SwinTransformer_tiny_patch4_window7_224_infer.tar +det_inference_url: +infer_quant:False +inference_cmd:./deploy/cpp/build/clas_system -c inference_cls.yaml use_gpu:True|False -gpu_id:0 -gpu_mem:4000 -cpu_math_library_num_threads:10 - -# cls config -cls_model_path:./deploy/models/SwinTransformer_tiny_patch4_window7_224_infer/inference.pdmodel -cls_params_path:./deploy/models/SwinTransformer_tiny_patch4_window7_224_infer/inference.pdiparams -resize_short_size:256 -crop_size:224 \ No newline at end of file +enable_mkldnn:False +cpu_threads:1 +batch_size:1 +use_tensorrt:False +precision:fp32 +image_dir:./dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG +benchmark:False +generate_yaml_cmd:python3.7 test_tipc/generate_cpp_yaml.py diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index 92c77b6d6a3ba3eedefe2e8e9227508b9e50d644..decd3a0518983d97d7c6d5267e7843ef653dc9f1 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -12,7 +12,7 @@ dataline=$(cat ${FILENAME}) IFS=$'\n' lines=(${dataline}) -function func_parser_key(){ +function func_parser_key() { strs=$1 IFS=":" array=(${strs}) @@ -20,31 +20,31 @@ function func_parser_key(){ echo ${tmp} } -function func_parser_value(){ +function func_parser_value() { strs=$1 IFS=":" array=(${strs}) if [ ${#array[*]} = 2 ]; then echo ${array[1]} else - IFS="|" - tmp="${array[1]}:${array[2]}" + IFS="|" + tmp="${array[1]}:${array[2]}" echo ${tmp} fi } -function func_get_url_file_name(){ +function func_get_url_file_name() { strs=$1 IFS="/" array=(${strs}) - tmp=${array[${#array[@]}-1]} + tmp=${array[${#array[@]} - 1]} echo ${tmp} } model_name=$(func_parser_value "${lines[1]}") -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 +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 echo "################### build opencv skipped ###################" else echo "################### build opencv ###################" @@ -60,22 +60,22 @@ if [ ${MODE} = "cpp_infer" ];then cd build cmake .. \ - -DCMAKE_INSTALL_PREFIX=${install_path} \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=OFF \ - -DWITH_IPP=OFF \ - -DBUILD_IPP_IW=OFF \ - -DWITH_LAPACK=OFF \ - -DWITH_EIGEN=OFF \ - -DCMAKE_INSTALL_LIBDIR=lib64 \ - -DWITH_ZLIB=ON \ - -DBUILD_ZLIB=ON \ - -DWITH_JPEG=ON \ - -DBUILD_JPEG=ON \ - -DWITH_PNG=ON \ - -DBUILD_PNG=ON \ - -DWITH_TIFF=ON \ - -DBUILD_TIFF=ON + -DCMAKE_INSTALL_PREFIX=${install_path} \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + -DWITH_IPP=OFF \ + -DBUILD_IPP_IW=OFF \ + -DWITH_LAPACK=OFF \ + -DWITH_EIGEN=OFF \ + -DCMAKE_INSTALL_LIBDIR=lib64 \ + -DWITH_ZLIB=ON \ + -DBUILD_ZLIB=ON \ + -DWITH_JPEG=ON \ + -DBUILD_JPEG=ON \ + -DWITH_PNG=ON \ + -DBUILD_PNG=ON \ + -DWITH_TIFF=ON \ + -DBUILD_TIFF=ON make -j make install @@ -83,167 +83,45 @@ if [ ${MODE} = "cpp_infer" ];then popd echo "################### build opencv finished ###################" fi - set_OPENCV_DIR_cmd="sed -i '1s#OPENCV_DIR=.*#OPENCV_DIR=../opencv-3.4.7/opencv3/#' './deploy/cpp/tools/build.sh'" - eval ${set_OPENCV_DIR_cmd} - if [ -d "./deploy/cpp/paddle_inference/" ]; then - echo "################### build paddle inference lib skipped ###################" + if [[ $FILENAME == *infer_cpp_linux_gpu_cpu.txt ]]; then + cpp_type=$(func_parser_value "${lines[2]}") + cls_inference_model_dir=$(func_parser_value "${lines[3]}") + det_inference_model_dir=$(func_parser_value "${lines[4]}") + cls_inference_url=$(func_parser_value "${lines[5]}") + det_inference_url=$(func_parser_value "${lines[6]}") + + if [[ $cpp_type == "cls" ]]; then + eval "wget -nc $cls_inference_url" + tar xf "${model_name}_infer.tar" + eval "mv ${model_name}_infer $cls_inference_model_dir" + cd dataset + rm -rf ILSVRC2012 + wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/whole_chain/whole_chain_infer.tar + tar xf whole_chain_infer.tar + ln -s whole_chain_infer ILSVRC2012 + cd .. + elif [[ $cpp_type == "shitu" ]]; then + eval "wget -nc $cls_inference_url" + tar_name=$(func_get_url_file_name "$cls_inference_url") + model_dir=${tar_name%.*} + eval "tar xf ${tar_name}" + eval "mv ${model_dir}_infer ${cls_inference_model_dir}" + + eval "wget -nc $det_inference_url" + tar_name=$(func_get_url_file_name "$det_inference_url") + model_dir=${tar_name%.*} + eval "tar xf ${tar_name}" + eval "mv ${model_dir}_infer ${det_inference_model_dir}" + 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 + else + echo "Wrong cpp type in config file in line 3. only support cls, shitu" + fi + exit 0 else - pushd ./deploy/cpp/ - wget https://paddle-inference-lib.bj.bcebos.com/2.1.1-gpu-cuda10.2-cudnn8.1-mkl-gcc8.2/paddle_inference.tgz - tar -xvf paddle_inference.tgz - echo "################### build paddle inference lib finished ###################" - fi - set_LIB_DIR_cmd="sed -i '2s#LIB_DIR=.*#LIB_DIR=../paddle_inference/#' './deploy/cpp/tools/build.sh'" - # echo ${set_LIB_DIR_cmd} - eval ${set_LIB_DIR_cmd} - # exit - if [ -d "./deploy/cpp/build/" ]; then - echo "################### build cpp inference skipped ###################" - else - pushd ./deploy/cpp/ - bash tools/build.sh - popd - echo "################### build cpp inference finished ###################" - fi - - if [ ${model_name} == "ResNet50" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ResNet50_infer.tar - tar xf ResNet50_infer.tar - cd ../../ - elif [ ${model_name} == "ResNet50_vd" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ResNet50_vd_infer.tar - tar xf ResNet50_vd_infer.tar - cd ../../ - elif [ ${model_name} == "MobileNetV3_large_x1_0" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/MobileNetV3_large_x1_0_infer.tar - tar xf MobileNetV3_large_x1_0_infer.tar - cd ../../ - elif [ ${model_name} == "SwinTransformer_tiny_patch4_window7_224" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/SwinTransformer_tiny_patch4_window7_224_infer.tar - tar xf SwinTransformer_tiny_patch4_window7_224_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x0_25" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_25_infer.tar - tar xf PPLCNet_x0_25_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x0_35" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_35_infer.tar - tar xf PPLCNet_x0_35_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x0_5" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_5_infer.tar - tar xf PPLCNet_x0_5_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x0_75" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_75_infer.tar - tar xf PPLCNet_x0_75_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x1_0" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x1_0_infer.tar - tar xf PPLCNet_x1_0_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x1_5" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x1_5_infer.tar - tar xf PPLCNet_x1_5_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x2_0" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x2_0_infer.tar - tar xf PPLCNet_x2_0_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x2_5" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x2_5_infer.tar - tar xf PPLCNet_x2_5_infer.tar - cd ../../ - elif [ ${model_name} == "PP-ShiTu_general_rec" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/general_PPLCNet_x2_5_lite_v1.0_infer.tar - tar xf general_PPLCNet_x2_5_lite_v1.0_infer.tar - cd ../../ - elif [ ${model_name} == "PP-ShiTu_mainbody_det" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer.tar - tar xf picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNetV2_base" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNetV2_base_infer.tar - tar xf PPLCNetV2_base_infer.tar - cd ../../ - elif [ ${model_name} == "PPHGNet_tiny" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPHGNet_tiny_infer.tar - tar xf PPHGNet_tiny_infer.tar - cd ../../ - elif [ ${model_name} == "PPHGNet_small" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPHGNet_small_infer.tar - tar xf PPHGNet_small_infer.tar - cd ../../ - else - echo "Not added into TIPC yet." + echo "use wrong config file" + exit 1 fi fi @@ -251,30 +129,30 @@ model_name=$(func_parser_value "${lines[1]}") model_url_value=$(func_parser_value "${lines[35]}") model_url_key=$(func_parser_key "${lines[35]}") -if [[ $FILENAME == *GeneralRecognition* ]];then - cd dataset - rm -rf Aliproduct - rm -rf train_reg_all_data.txt - rm -rf demo_train - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/whole_chain/tipc_shitu_demo_data.tar - tar -xf tipc_shitu_demo_data.tar - ln -s tipc_shitu_demo_data Aliproduct - ln -s tipc_shitu_demo_data/demo_train.txt train_reg_all_data.txt - ln -s tipc_shitu_demo_data/demo_train demo_train - cd tipc_shitu_demo_data - ln -s demo_test.txt val_list.txt - cd ../../ - eval "wget -nc $model_url_value" - mv general_PPLCNet_x2_5_pretrained_v1.0.pdparams GeneralRecognition_PPLCNet_x2_5_pretrained.pdparams - exit 0 +if [[ $FILENAME == *GeneralRecognition* ]]; then + cd dataset + rm -rf Aliproduct + rm -rf train_reg_all_data.txt + rm -rf demo_train + wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/whole_chain/tipc_shitu_demo_data.tar + tar -xf tipc_shitu_demo_data.tar + ln -s tipc_shitu_demo_data Aliproduct + ln -s tipc_shitu_demo_data/demo_train.txt train_reg_all_data.txt + ln -s tipc_shitu_demo_data/demo_train demo_train + cd tipc_shitu_demo_data + ln -s demo_test.txt val_list.txt + cd ../../ + eval "wget -nc $model_url_value" + mv general_PPLCNet_x2_5_pretrained_v1.0.pdparams GeneralRecognition_PPLCNet_x2_5_pretrained.pdparams + exit 0 fi -if [[ $FILENAME == *use_dali* ]];then +if [[ $FILENAME == *use_dali* ]]; then python_name=$(func_parser_value "${lines[2]}") ${python_name} -m pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/nightly --upgrade nvidia-dali-nightly-cuda102 fi -if [ ${MODE} = "lite_train_lite_infer" ] || [ ${MODE} = "lite_train_whole_infer" ];then +if [ ${MODE} = "lite_train_lite_infer" ] || [ ${MODE} = "lite_train_whole_infer" ]; then # pretrain lite train data cd dataset rm -rf ILSVRC2012 @@ -286,7 +164,7 @@ if [ ${MODE} = "lite_train_lite_infer" ] || [ ${MODE} = "lite_train_whole_infer" mv val.txt val_list.txt cp -r train/* val/ cd ../../ -elif [ ${MODE} = "whole_infer" ] || [ ${MODE} = "klquant_whole_infer" ];then +elif [ ${MODE} = "whole_infer" ] || [ ${MODE} = "klquant_whole_infer" ]; then # download data cd dataset rm -rf ILSVRC2012 @@ -300,15 +178,15 @@ elif [ ${MODE} = "whole_infer" ] || [ ${MODE} = "klquant_whole_infer" ];then # download inference or pretrained model eval "wget -nc $model_url_value" if [[ $model_url_key == *inference* ]]; then - rm -rf inference - tar xf "${model_name}_inference.tar" + rm -rf inference + tar xf "${model_name}_infer.tar" 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" - eval $cmd + 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" + eval $cmd fi -elif [ ${MODE} = "whole_train_whole_infer" ];then +elif [ ${MODE} = "whole_train_whole_infer" ]; then cd dataset rm -rf ILSVRC2012 wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/whole_chain/whole_chain_CIFAR100.tar @@ -320,7 +198,7 @@ elif [ ${MODE} = "whole_train_whole_infer" ];then cd ../../ fi -if [ ${MODE} = "serving_infer" ];then +if [ ${MODE} = "serving_infer" ]; then # prepare serving env python_name=$(func_parser_value "${lines[2]}") ${python_name} -m pip install install paddle-serving-server-gpu==0.6.1.post101 @@ -332,153 +210,19 @@ if [ ${MODE} = "serving_infer" ];then wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ResNet50_vd_infer.tar && tar xf ResNet50_vd_infer.tar fi -if [ ${MODE} = "paddle2onnx_infer" ];then +if [ ${MODE} = "paddle2onnx_infer" ]; then # prepare paddle2onnx env python_name=$(func_parser_value "${lines[2]}") ${python_name} -m pip install install paddle2onnx ${python_name} -m pip install onnxruntime - if [ ${model_name} == "ResNet50" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ResNet50_infer.tar - tar xf ResNet50_infer.tar - cd ../../ - elif [ ${model_name} == "ResNet50_vd" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ResNet50_vd_infer.tar - tar xf ResNet50_vd_infer.tar - cd ../../ - elif [ ${model_name} == "MobileNetV3_large_x1_0" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/MobileNetV3_large_x1_0_infer.tar - tar xf MobileNetV3_large_x1_0_infer.tar - cd ../../ - elif [ ${model_name} == "SwinTransformer_tiny_patch4_window7_224" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/SwinTransformer_tiny_patch4_window7_224_infer.tar - tar xf SwinTransformer_tiny_patch4_window7_224_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x0_25" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_25_infer.tar - tar xf PPLCNet_x0_25_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x0_35" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_35_infer.tar - tar xf PPLCNet_x0_35_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x0_5" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_5_infer.tar - tar xf PPLCNet_x0_5_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x0_75" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x0_75_infer.tar - tar xf PPLCNet_x0_75_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x1_0" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x1_0_infer.tar - tar xf PPLCNet_x1_0_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x1_5" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x1_5_infer.tar - tar xf PPLCNet_x1_5_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x2_0" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x2_0_infer.tar - tar xf PPLCNet_x2_0_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNet_x2_5" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNet_x2_5_infer.tar - tar xf PPLCNet_x2_5_infer.tar - cd ../../ - elif [ ${model_name} == "PP-ShiTu_general_rec" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/general_PPLCNet_x2_5_lite_v1.0_infer.tar - tar xf general_PPLCNet_x2_5_lite_v1.0_infer.tar - cd ../../ - elif [ ${model_name} == "PP-ShiTu_mainbody_det" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer.tar - tar xf picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer.tar - cd ../../ - elif [ ${model_name} == "PPLCNetV2_base" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPLCNetV2_base_infer.tar - tar xf PPLCNetV2_base_infer.tar - cd ../../ - elif [ ${model_name} == "PPHGNet_tiny" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPHGNet_tiny_infer.tar - tar xf PPHGNet_tiny_infer.tar - cd ../../ - elif [ ${model_name} == "PPHGNet_small" ]; then - # wget model - cd deploy - mkdir models - cd models - wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/PPHGNet_small_infer.tar - tar xf PPHGNet_small_infer.tar - cd ../../ - else - echo "Not added into TIPC yet." - fi + + # wget model + cd deploy && mkdir models && cd models + wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ResNet50_vd_infer.tar && tar xf ResNet50_vd_infer.tar + cd ../../ fi -if [ ${MODE} = "benchmark_train" ];then +if [ ${MODE} = "benchmark_train" ]; then pip install -r requirements.txt cd dataset rm -rf ILSVRC2012 @@ -486,6 +230,6 @@ if [ ${MODE} = "benchmark_train" ];then tar xf ILSVRC2012_val.tar ln -s ILSVRC2012_val ILSVRC2012 cd ILSVRC2012 - ln -s val_list.txt train_list.txt + ln -s val_list.txt train_list.txt cd ../../ fi diff --git a/test_tipc/test_inference_cpp.sh b/test_tipc/test_inference_cpp.sh index 3cfaf4fab5a64e02278ae4eba8380ebffdea9133..3ca305def6e93c46098fb7899d8c12eba092ffb8 100644 --- a/test_tipc/test_inference_cpp.sh +++ b/test_tipc/test_inference_cpp.sh @@ -1,73 +1,264 @@ #!/bin/bash source test_tipc/common_func.sh -function func_parser_key_cpp(){ - strs=$1 - IFS=" " - array=(${strs}) - tmp=${array[0]} - echo ${tmp} -} - -function func_parser_value_cpp(){ - strs=$1 - IFS=":" - array=(${strs}) - tmp=${array[1]} - echo ${tmp} -} - FILENAME=$1 - -dataline=$(cat ${FILENAME}) -lines=(${dataline}) +GPUID=$2 +if [[ ! $GPUID ]];then + GPUID=0 +fi +dataline=$(awk 'NR==1, NR==18{print}' $FILENAME) # parser params -dataline=$(awk 'NR==1, NR==14{print}' $FILENAME) IFS=$'\n' lines=(${dataline}) +# parser cpp inference model +model_name=$(func_parser_value "${lines[1]}") +cpp_infer_type=$(func_parser_value "${lines[2]}") +cpp_infer_model_dir=$(func_parser_value "${lines[3]}") +cpp_det_infer_model_dir=$(func_parser_value "${lines[4]}") +cpp_infer_is_quant=$(func_parser_value "${lines[7]}") +# parser cpp inference +inference_cmd=$(func_parser_value "${lines[8]}") +cpp_use_gpu_list=$(func_parser_value "${lines[9]}") +cpp_use_mkldnn_list=$(func_parser_value "${lines[10]}") +cpp_cpu_threads_list=$(func_parser_value "${lines[11]}") +cpp_batch_size_list=$(func_parser_value "${lines[12]}") +cpp_use_trt_list=$(func_parser_value "${lines[13]}") +cpp_precision_list=$(func_parser_value "${lines[14]}") +cpp_image_dir_value=$(func_parser_value "${lines[15]}") +cpp_benchmark_value=$(func_parser_value "${lines[16]}") +generate_yaml_cmd=$(func_parser_value "${lines[17]}") +transform_index_cmd=$(func_parser_value "${lines[18]}") -# parser load config -model_name=$(func_parser_value_cpp "${lines[1]}") -use_gpu_key=$(func_parser_key_cpp "${lines[2]}") -use_gpu_value=$(func_parser_value_cpp "${lines[2]}") -LOG_PATH="./test_tipc/output/${model_name}/infer_cpp" +LOG_PATH="./test_tipc/output/${model_name}" mkdir -p ${LOG_PATH} -status_log="${LOG_PATH}/results_infer_cpp.log" +status_log="${LOG_PATH}/results_cpp.log" +# generate_yaml_cmd="python3 test_tipc/generate_cpp_yaml.py" -line_inference_model_dir=3 -line_use_gpu=5 -line_infer_imgs=2 -function func_infer_cpp(){ - # inference cpp +function func_shitu_cpp_inference(){ IFS='|' - for use_gpu in ${use_gpu_value[*]}; do - if [[ ${use_gpu} = "True" ]]; then - _save_log_path="${LOG_PATH}/infer_cpp_use_gpu.log" - else - _save_log_path="${LOG_PATH}/infer_cpp_use_cpu.log" - fi - # run infer cpp - inference_cpp_cmd="./deploy/cpp/build/clas_system" - inference_cpp_cfg="./deploy/configs/inference_cls.yaml" + _script=$1 + _model_dir=$2 + _log_path=$3 + _img_dir=$4 + _flag_quant=$5 + # inference - set_model_name_cmd="sed -i '${line_inference_model_dir}s#: .*#: ./deploy/models/${model_name}_infer#' '${inference_cpp_cfg}'" - eval $set_model_name_cmd + for use_gpu in ${cpp_use_gpu_list[*]}; do + if [ ${use_gpu} = "False" ] || [ ${use_gpu} = "cpu" ]; then + for use_mkldnn in ${cpp_use_mkldnn_list[*]}; do + if [ ${use_mkldnn} = "False" ] && [ ${_flag_quant} = "True" ]; then + continue + fi + for threads in ${cpp_cpu_threads_list[*]}; do + for batch_size in ${cpp_batch_size_list[*]}; do + precision="fp32" + if [ ${use_mkldnn} = "False" ] && [ ${_flag_quant} = "True" ]; then + precison="int8" + fi + _save_log_path="${_log_path}/shitu_cpp_infer_cpu_usemkldnn_${use_mkldnn}_threads_${threads}_precision_${precision}_batchsize_${batch_size}.log" - set_infer_imgs_cmd="sed -i '${line_infer_imgs}s#: .*#: ./deploy/images/ILSVRC2012_val_00000010.jpeg#' '${inference_cpp_cfg}'" - eval $set_infer_imgs_cmd + command="${generate_yaml_cmd} --type shitu --batch_size ${batch_size} --mkldnn ${use_mkldnn} --gpu ${use_gpu} --cpu_thread ${threads} --tensorrt False --precision ${precision} --data_dir ${_img_dir} --benchmark True --cls_model_dir ${cpp_infer_model_dir} --det_model_dir ${cpp_det_infer_model_dir} --gpu_id ${GPUID}" + eval $command + eval $transform_index_cmd + command="${_script} 2>&1|tee ${_save_log_path}" + eval $command + last_status=${PIPESTATUS[0]} + status_check $last_status "${command}" "${status_log}" + done + done + done + elif [ ${use_gpu} = "True" ] || [ ${use_gpu} = "gpu" ]; then + for use_trt in ${cpp_use_trt_list[*]}; do + for precision in ${cpp_precision_list[*]}; do + if [[ ${_flag_quant} = "False" ]] && [[ ${precision} =~ "int8" ]]; then + continue + fi + if [[ ${precision} =~ "fp16" || ${precision} =~ "int8" ]] && [ ${use_trt} = "False" ]; then + continue + fi + if [[ ${use_trt} = "False" || ${precision} =~ "int8" ]] && [ ${_flag_quant} = "True" ]; then + continue + fi + for batch_size in ${cpp_batch_size_list[*]}; do + _save_log_path="${_log_path}/shitu_cpp_infer_gpu_usetrt_${use_trt}_precision_${precision}_batchsize_${batch_size}.log" + command="${generate_yaml_cmd} --type shitu --batch_size ${batch_size} --mkldnn False --gpu ${use_gpu} --cpu_thread 1 --tensorrt ${use_trt} --precision ${precision} --data_dir ${_img_dir} --benchmark True --cls_model_dir ${cpp_infer_model_dir} --det_model_dir ${cpp_det_infer_model_dir} --gpu_id ${GPUID}" + eval $command + eval $transform_index_cmd + command="${_script} 2>&1|tee ${_save_log_path}" + eval $command + last_status=${PIPESTATUS[0]} + status_check $last_status "${_script}" "${status_log}" + done + done + done + else + echo "Does not support hardware other than CPU and GPU Currently!" + fi + done +} - set_use_gpu_cmd="sed -i '${line_use_gpu}s#: .*#: ${use_gpu}#' '${inference_cpp_cfg}'" - eval $set_use_gpu_cmd +function func_cls_cpp_inference(){ + IFS='|' + _script=$1 + _model_dir=$2 + _log_path=$3 + _img_dir=$4 + _flag_quant=$5 + # inference - infer_cpp_full_cmd="${inference_cpp_cmd} -c ${inference_cpp_cfg} > ${_save_log_path} 2>&1 " - eval $infer_cpp_full_cmd + for use_gpu in ${cpp_use_gpu_list[*]}; do + if [ ${use_gpu} = "False" ] || [ ${use_gpu} = "cpu" ]; then + for use_mkldnn in ${cpp_use_mkldnn_list[*]}; do + if [ ${use_mkldnn} = "False" ] && [ ${_flag_quant} = "True" ]; then + continue + fi + for threads in ${cpp_cpu_threads_list[*]}; do + for batch_size in ${cpp_batch_size_list[*]}; do + precision="fp32" + if [ ${use_mkldnn} = "False" ] && [ ${_flag_quant} = "True" ]; then + precison="int8" + fi + _save_log_path="${_log_path}/cls_cpp_infer_cpu_usemkldnn_${use_mkldnn}_threads_${threads}_precision_${precision}_batchsize_${batch_size}.log" - last_status=${PIPESTATUS[0]} - status_check $last_status "${infer_cpp_full_cmd}" "${status_log}" "${model_name}" + command="${generate_yaml_cmd} --type cls --batch_size ${batch_size} --mkldnn ${use_mkldnn} --gpu ${use_gpu} --cpu_thread ${threads} --tensorrt False --precision ${precision} --data_dir ${_img_dir} --benchmark True --cls_model_dir ${cpp_infer_model_dir} --gpu_id ${GPUID}" + eval $command + command1="${_script} 2>&1|tee ${_save_log_path}" + eval ${command1} + last_status=${PIPESTATUS[0]} + status_check $last_status "${command1}" "${status_log}" + done + done + done + elif [ ${use_gpu} = "True" ] || [ ${use_gpu} = "gpu" ]; then + for use_trt in ${cpp_use_trt_list[*]}; do + for precision in ${cpp_precision_list[*]}; do + if [[ ${_flag_quant} = "False" ]] && [[ ${precision} =~ "int8" ]]; then + continue + fi + if [[ ${precision} =~ "fp16" || ${precision} =~ "int8" ]] && [ ${use_trt} = "False" ]; then + continue + fi + if [[ ${use_trt} = "False" || ${precision} =~ "int8" ]] && [ ${_flag_quant} = "True" ]; then + continue + fi + for batch_size in ${cpp_batch_size_list[*]}; do + _save_log_path="${_log_path}/cls_cpp_infer_gpu_usetrt_${use_trt}_precision_${precision}_batchsize_${batch_size}.log" + command="${generate_yaml_cmd} --type cls --batch_size ${batch_size} --mkldnn False --gpu ${use_gpu} --cpu_thread 1 --tensorrt ${use_trt} --precision ${precision} --data_dir ${_img_dir} --benchmark True --cls_model_dir ${cpp_infer_model_dir} --gpu_id ${GPUID}" + eval $command + command="${_script} 2>&1|tee ${_save_log_path}" + eval $command + last_status=${PIPESTATUS[0]} + status_check $last_status "${command}" "${status_log}" + done + done + done + else + echo "Does not support hardware other than CPU and GPU Currently!" + fi done } -echo "################### run test cpp inference ###################" -func_infer_cpp \ No newline at end of file +if [[ $cpp_infer_type == "cls" ]]; then + cd deploy/cpp +elif [[ $cpp_infer_type == "shitu" ]]; then + cd deploy/cpp_shitu +else + echo "Only support cls and shitu" + exit 0 +fi + +if [[ $cpp_infer_type == "shitu" ]]; then + echo "################### update cmake ###################" + wget -nc https://github.com/Kitware/CMake/releases/download/v3.22.0/cmake-3.22.0.tar.gz + tar xf cmake-3.22.0.tar.gz + cd ./cmake-3.22.0 + export root_path=$PWD + export install_path=${root_path}/cmake + eval "./bootstrap --prefix=${install_path}" + make -j + make install + export PATH=${install_path}/bin:$PATH + cd .. + echo "################### update cmake done ###################" + + echo "################### build faiss ###################" + apt-get install -y libopenblas-dev + git clone https://github.com/facebookresearch/faiss.git + cd faiss + export faiss_install_path=$PWD/faiss_install + eval "cmake -B build . -DFAISS_ENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=${faiss_install_path}" + make -C build -j faiss + make -C build install + cd .. +fi + +echo "################### build PaddleClas demo ####################" +# pwd = /workspace/hesensen/PaddleClas/deploy/cpp_shitu +OPENCV_DIR=$(dirname $PWD)/cpp/opencv-3.4.7/opencv3/ +LIB_DIR=$(dirname $PWD)/cpp/paddle_inference/ + +CUDA_LIB_DIR=$(dirname `find /usr -name libcudart.so`) +CUDNN_LIB_DIR=$(dirname `find /usr -name libcudnn.so`) + +BUILD_DIR=build +rm -rf ${BUILD_DIR} +mkdir ${BUILD_DIR} +cd ${BUILD_DIR} +if [[ $cpp_infer_type == cls ]]; then + cmake .. \ + -DPADDLE_LIB=${LIB_DIR} \ + -DWITH_MKL=ON \ + -DWITH_GPU=ON \ + -DWITH_STATIC_LIB=OFF \ + -DWITH_TENSORRT=OFF \ + -DOPENCV_DIR=${OPENCV_DIR} \ + -DCUDNN_LIB=${CUDNN_LIB_DIR} \ + -DCUDA_LIB=${CUDA_LIB_DIR} \ + -DTENSORRT_DIR=${TENSORRT_DIR} +else + cmake ..\ + -DPADDLE_LIB=${LIB_DIR} \ + -DWITH_MKL=ON \ + -DWITH_GPU=ON \ + -DWITH_STATIC_LIB=OFF \ + -DWITH_TENSORRT=OFF \ + -DOPENCV_DIR=${OPENCV_DIR} \ + -DCUDNN_LIB=${CUDNN_LIB_DIR} \ + -DCUDA_LIB=${CUDA_LIB_DIR} \ + -DTENSORRT_DIR=${TENSORRT_DIR} \ + -DFAISS_DIR=${faiss_install_path} \ + -DFAISS_WITH_MKL=OFF +fi +make -j +cd ../../../ +# cd ../../ +echo "################### build PaddleClas demo finished ###################" + + +# set cuda device +# GPUID=$2 +# if [ ${#GPUID} -le 0 ];then +# env="export CUDA_VISIBLE_DEVICES=0" +# else +# env="export CUDA_VISIBLE_DEVICES=${GPUID}" +# fi +# set CUDA_VISIBLE_DEVICES +# eval $env + + +echo "################### run test ###################" +export Count=0 +IFS="|" +infer_quant_flag=(${cpp_infer_is_quant}) +for infer_model in ${cpp_infer_model_dir[*]}; do + #run inference + is_quant=${infer_quant_flag[Count]} + if [[ $cpp_infer_type == "cls" ]]; then + func_cls_cpp_inference "${inference_cmd}" "${infer_model}" "${LOG_PATH}" "${cpp_image_dir_value}" ${is_quant} + else + func_shitu_cpp_inference "${inference_cmd}" "${infer_model}" "${LOG_PATH}" "${cpp_image_dir_value}" ${is_quant} + fi + Count=$(($Count + 1)) +done