diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0b4139876976f0f1c34619a8fb4e0b3b6c35c9e0 100644 --- a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt +++ b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt @@ -0,0 +1,16 @@ +===========================cpp_infer_params=========================== +model_name:ocr_det +use_opencv:True +infer_model:./inference/ch_ppocr_mobile_v2.0_det_infer/ +infer_quant:False +inference:./deploy/cpp_infer/build/ppocr det +--use_gpu:True|False +--enable_mkldnn:True|False +--cpu_threads:1|6 +--rec_batch_num:1 +--use_tensorrt:False|True +--precision:fp32|fp16 +--det_model_dir: +--image_dir:./inference/ch_det_data_50/all-sum-510/ +null:null +--benchmark:True \ No newline at end of file diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index 61ac2f3450c39617832913f2ad1b0bd2ec815e35..6e07bf8a1ac174b93f9abe141a00f32da169d9d5 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -1,4 +1,6 @@ #!/bin/bash +source test_tipc/common_func.sh + FILENAME=$1 # MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer', @@ -12,30 +14,12 @@ dataline=$(cat ${FILENAME}) # parser params IFS=$'\n' lines=(${dataline}) -function func_parser_key(){ - strs=$1 - IFS=":" - array=(${strs}) - tmp=${array[0]} - echo ${tmp} -} -function func_parser_value(){ - strs=$1 - IFS=":" - array=(${strs}) - tmp=${array[1]} - echo ${tmp} -} -IFS=$'\n' + # The training params model_name=$(func_parser_value "${lines[1]}") trainer_list=$(func_parser_value "${lines[14]}") -# MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer', -# 'whole_infer', 'klquant_whole_infer', -# 'cpp_infer', 'serving_infer'] -MODE=$2 if [ ${MODE} = "lite_train_lite_infer" ];then # pretrain lite train data diff --git a/test_tipc/test_inference_cpp.sh b/test_tipc/test_inference_cpp.sh index 3f8b54b189349aa9c011a56f6f12752b771ce43e..d26954353ef1e81ae49364b7f9d20357768cff85 100644 --- a/test_tipc/test_inference_cpp.sh +++ b/test_tipc/test_inference_cpp.sh @@ -2,38 +2,38 @@ source test_tipc/common_func.sh FILENAME=$1 -dataline=$(awk 'NR==52, NR==66{print}' $FILENAME) +dataline=$(awk 'NR==1, NR==16{print}' $FILENAME) # parser params IFS=$'\n' lines=(${dataline}) # parser cpp inference model -use_opencv=$(func_parser_value "${lines[1]}") -cpp_infer_model_dir_list=$(func_parser_value "${lines[2]}") -cpp_infer_is_quant=$(func_parser_value "${lines[3]}") +model_name=$(func_parser_value "${lines[1]}") +use_opencv=$(func_parser_value "${lines[2]}") +cpp_infer_model_dir_list=$(func_parser_value "${lines[3]}") +cpp_infer_is_quant=$(func_parser_value "${lines[4]}") # parser cpp inference -inference_cmd=$(func_parser_value "${lines[4]}") -cpp_use_gpu_key=$(func_parser_key "${lines[5]}") -cpp_use_gpu_list=$(func_parser_value "${lines[5]}") -cpp_use_mkldnn_key=$(func_parser_key "${lines[6]}") -cpp_use_mkldnn_list=$(func_parser_value "${lines[6]}") -cpp_cpu_threads_key=$(func_parser_key "${lines[7]}") -cpp_cpu_threads_list=$(func_parser_value "${lines[7]}") -cpp_batch_size_key=$(func_parser_key "${lines[8]}") -cpp_batch_size_list=$(func_parser_value "${lines[8]}") -cpp_use_trt_key=$(func_parser_key "${lines[9]}") -cpp_use_trt_list=$(func_parser_value "${lines[9]}") -cpp_precision_key=$(func_parser_key "${lines[10]}") -cpp_precision_list=$(func_parser_value "${lines[10]}") -cpp_infer_model_key=$(func_parser_key "${lines[11]}") -cpp_image_dir_key=$(func_parser_key "${lines[12]}") -cpp_infer_img_dir=$(func_parser_value "${lines[12]}") -cpp_infer_key1=$(func_parser_key "${lines[13]}") -cpp_infer_value1=$(func_parser_value "${lines[13]}") -cpp_benchmark_key=$(func_parser_key "${lines[14]}") -cpp_benchmark_value=$(func_parser_value "${lines[14]}") - +inference_cmd=$(func_parser_value "${lines[5]}") +cpp_use_gpu_key=$(func_parser_key "${lines[6]}") +cpp_use_gpu_list=$(func_parser_value "${lines[6]}") +cpp_use_mkldnn_key=$(func_parser_key "${lines[7]}") +cpp_use_mkldnn_list=$(func_parser_value "${lines[7]}") +cpp_cpu_threads_key=$(func_parser_key "${lines[8]}") +cpp_cpu_threads_list=$(func_parser_value "${lines[8]}") +cpp_batch_size_key=$(func_parser_key "${lines[9]}") +cpp_batch_size_list=$(func_parser_value "${lines[9]}") +cpp_use_trt_key=$(func_parser_key "${lines[10]}") +cpp_use_trt_list=$(func_parser_value "${lines[10]}") +cpp_precision_key=$(func_parser_key "${lines[11]}") +cpp_precision_list=$(func_parser_value "${lines[11]}") +cpp_infer_model_key=$(func_parser_key "${lines[12]}") +cpp_image_dir_key=$(func_parser_key "${lines[13]}") +cpp_infer_img_dir=$(func_parser_value "${lines[13]}") +cpp_infer_key1=$(func_parser_key "${lines[14]}") +cpp_infer_value1=$(func_parser_value "${lines[14]}") +cpp_benchmark_key=$(func_parser_key "${lines[15]}") +cpp_benchmark_value=$(func_parser_value "${lines[15]}") LOG_PATH="./test_tipc/output" mkdir -p ${LOG_PATH}