未验证 提交 b0e3ce94 编写于 作者: L LokeZhou 提交者: GitHub

[TIPC] lite_train_lite_infer (#7426)

* [TIPC] lite_train_lite_infer
add ppyoloe+ fcosr ppyoloe_r sod

* [TIPC] add pp-vehicle pp-human ocsort vitdet
上级 e9563204
===========================train_params===========================
model_name:ocsort_ppyoloe
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=30
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=4
pretrain_weights:null
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/mot/test.mp4
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c configs/mot/ocsort/ocsort_ppyoloe.yml -o
pact_train:tools/train.py -c configs/mot/ocsort/ocsort_ppyoloe.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/mot/ocsort/ocsort_ppyoloe.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval_mot.py -c configs/mot/ocsort/ocsort_ppyoloe.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://bj.bcebos.com/v1/paddledet/models/mot/ppyoloe_crn_l_36e_640x640_mot17half.pdparams
norm_export:tools/export_model.py -c configs/mot/bytetrack/detector/ppyoloe_crn_l_36e_640x640_mot17half.yml -o
pact_export:tools/export_model.py -c configs/mot/bytetrack/detector/ppyoloe_crn_l_36e_640x640_mot17half.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/mot/bytetrack/detector/ppyoloe_crn_l_36e_640x640_mot17half.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/mot/ocsort/ocsort_ppyoloe.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/pptracking/python/mot_sde_infer.py --tracker_config deploy/pptracking/python/tracker_config.yml
--device:gpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--video_file:./dataset/mot/test.mp4
--save_log_path:null
--run_benchmark:False
--trt_max_shape:1600
===========================train_benchmark_params==========================
batch_size:4|12
fp_items:fp32|fp16
epoch:1
repeat:1
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x640x640.npy
\ No newline at end of file
===========================pipeline_infer_python_params===========================
model_name:pphuman
python:python3.7
filename:null
##
infer_mode:norm
input_list:image|video
use_gpu:True
inference:deploy/pipeline/pipeline.py --config=deploy/pipeline/config/infer_cfg_pphuman.yml
--device:cpu|gpu
--image_file:./demo/000000014439.jpg
--video_file:./dataset/mot/test.mp4
===========================pipeline_infer_python_params===========================
model_name:ppvehicle
python:python3.7
filename:null
##
infer_mode:norm
input_list:image|video
use_gpu:True
inference:deploy/pipeline/pipeline.py --config=deploy/pipeline/config/infer_cfg_ppvehicle.yml
--device:cpu|gpu
--image_file:./demo/000000014439.jpg
--video_file:./dataset/mot/test.mp4
===========================train_params===========================
model_name:ppyoloe_plus_crn_s_80e_coco
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=2
pretrain_weights:https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_s_80e_coco.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c configs/ppyoloe/ppyoloe_plus_crn_s_80e_coco.yml -o
pact_train:tools/train.py -c configs/ppyoloe/ppyoloe_plus_crn_s_80e_coco.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/ppyoloe/ppyoloe_plus_crn_s_80e_coco.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/ppyoloe/ppyoloe_plus_crn_s_80e_coco.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_s_80e_coco.pdparams
norm_export:tools/export_model.py -c configs/ppyoloe/ppyoloe_plus_crn_s_80e_coco.yml -o
pact_export:tools/export_model.py -c configs/ppyoloe/ppyoloe_plus_crn_s_80e_coco.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/ppyoloe/ppyoloe_plus_crn_s_80e_coco.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/ppyoloe/ppyoloe_plus_crn_s_80e_coco.yml --slim_config configs/slim/post_quant/ppyoloe_crn_s_300e_coco_ptq.yml -o
##
infer_mode:norm|kl_quant
infer_quant:False|True
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
--trt_max_shape:1600
===========================train_benchmark_params==========================
batch_size:8
fp_items:fp32|fp16
epoch:1
repeat:12
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x640x640.npy
\ No newline at end of file
_BASE_: [
'../../../../configs/datasets/spine_coco.yml',
'../../../../configs/runtime.yml',
'../../../../configs/rotate/fcosr/_base_/optimizer_3x.yml',
'../../../../configs/rotate/fcosr/_base_/fcosr_reader.yml',
'../../../../configs/rotate/fcosr/_base_/fcosr_x50.yml'
]
weights: output/fcosr_x50_3x_dota/model_final
===========================train_params===========================
model_name:fcosr_x50_3x_spine_coco
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=12
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=1
pretrain_weights:https://paddledet.bj.bcebos.com/models/fcosr_x50_3x_dota.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/spine_coco/test/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c test_tipc/configs/rotate/fcosr/fcosr_x50_3x_spine_coco.yml -o
pact_train:tools/train.py -c test_tipc/configs/rotate/fcosr/fcosr_x50_3x_spine_coco.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c test_tipc/configs/rotate/fcosr/fcosr_x50_3x_spine_coco.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c test_tipc/configs/rotate/fcosr/fcosr_x50_3x_spine_coco.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/fcosr_x50_3x_dota.pdparams
norm_export:tools/export_model.py -c test_tipc/configs/rotate/fcosr/fcosr_x50_3x_spine_coco.yml -o
pact_export:tools/export_model.py -c test_tipc/configs/rotate/fcosr/fcosr_x50_3x_spine_coco.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c test_tipc/configs/rotate/fcosr/fcosr_x50_3x_spine_coco.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c test_tipc/configs/rotate/fcosr/fcosr_x50_3x_spine_coco.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/spine_coco/test/
--save_log_path:null
--run_benchmark:False
null:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x1024x1024.npy
\ No newline at end of file
_BASE_: [
'../../../../configs/datasets/spine_coco.yml',
'../../../../configs/runtime.yml',
'../../../../configs/rotate/ppyoloe_r/_base_/optimizer_3x.yml',
'../../../../configs/rotate/ppyoloe_r/_base_/ppyoloe_r_reader.yml',
'../../../../configs/rotate/ppyoloe_r/_base_/ppyoloe_r_crn.yml'
]
log_iter: 50
snapshot_epoch: 1
weights: output/ppyoloe_r_crn_s_3x_dota/model_final
pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_s_pretrained.pdparams
depth_mult: 0.33
width_mult: 0.50
===========================train_params===========================
model_name:ppyoloe_r_crn_s_3x_spine_coco
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=12
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=1
pretrain_weights:https://paddledet.bj.bcebos.com/models/ppyoloe_r_crn_s_3x_dota.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/spine_coco/test/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c test_tipc/configs/rotate/ppyoloe_r/ppyoloe_r_crn_s_3x_spine_coco.yml -o
pact_train:tools/train.py -c test_tipc/configs/rotate/ppyoloe_r/ppyoloe_r_crn_s_3x_spine_coco.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c test_tipc/configs/rotate/ppyoloe_r/ppyoloe_r_crn_s_3x_spine_coco.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c test_tipc/configs/rotate/ppyoloe_r/ppyoloe_r_crn_s_3x_spine_coco.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/ppyoloe_r_crn_s_3x_dota.pdparams
norm_export:tools/export_model.py -c test_tipc/configs/rotate/ppyoloe_r/ppyoloe_r_crn_s_3x_spine_coco.yml -o
pact_export:tools/export_model.py -c test_tipc/configs/rotate/ppyoloe_r/ppyoloe_r_crn_s_3x_spine_coco.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c test_tipc/configs/rotate/ppyoloe_r/ppyoloe_r_crn_s_3x_spine_coco.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c test_tipc/configs/rotate/ppyoloe_r/ppyoloe_r_crn_s_3x_spine_coco.yml --slim_config _template_kl_quant -o
##
infer_mode:norm
infer_quant:False
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/spine_coco/test/
--save_log_path:null
--run_benchmark:False
null:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x1024x1024.npy
\ No newline at end of file
===========================train_params===========================
model_name:ppyoloe_plus_sod_crn_l_80e_coco
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=2
pretrain_weights:https://paddledet.bj.bcebos.com/models/ppyoloe_plus_sod_crn_l_80e_coco.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c configs/smalldet/ppyoloe_plus_sod_crn_l_80e_coco.yml -o
pact_train:tools/train.py -c configs/smalldet/ppyoloe_plus_sod_crn_l_80e_coco.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/smalldet/ppyoloe_plus_sod_crn_l_80e_coco.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/smalldet/ppyoloe_plus_sod_crn_l_80e_coco.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://paddledet.bj.bcebos.com/models/ppyoloe_plus_sod_crn_l_80e_coco.pdparams
norm_export:tools/export_model.py -c configs/smalldet/ppyoloe_plus_sod_crn_l_80e_coco.yml -o
pact_export:tools/export_model.py -c configs/smalldet/ppyoloe_plus_sod_crn_l_80e_coco.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/smalldet/ppyoloe_plus_sod_crn_l_80e_coco.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/ppyoloe/smalldet/ppyoloe_plus_sod_crn_l_80e_coco.yml --slim_config configs/slim/post_quant/ppyoloe_crn_s_300e_coco_ptq.yml -o
##
infer_mode:norm|kl_quant
infer_quant:False|True
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
--trt_max_shape:1600
===========================train_benchmark_params==========================
batch_size:8
fp_items:fp32|fp16
epoch:1
repeat:12
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x640x640.npy
\ No newline at end of file
===========================train_params===========================
model_name:cascade_rcnn_vit_base_hrfpn_cae_1x_coco
python:python3.7
gpu_list:0|0,1
use_gpu:True
auto_cast:null
epoch:lite_train_lite_infer=1|lite_train_whole_infer=1|whole_train_whole_infer=300
save_dir:null
TrainReader.batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=2
pretrain_weights:https://bj.bcebos.com/v1/paddledet/models/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.pdparams
trained_model_name:model_final.pdparams
train_infer_img_dir:./dataset/coco/test2017/
filename:null
##
trainer:norm_train
norm_train:tools/train.py -c configs/vitdet/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.yml -o
pact_train:tools/train.py -c configs/vitdet/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.yml --slim_config _template_pact -o
fpgm_train:tools/train.py -c configs/vitdet/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.yml --slim_config _template_fpgm -o
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c configs/vitdet/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.yml -o
null:null
##
===========================infer_params===========================
--output_dir:./output_inference
weights:https://bj.bcebos.com/v1/paddledet/models/pretrained/vit_base_cae_pretrained.pdparams
norm_export:tools/export_model.py -c configs/vitdet/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.yml -o
pact_export:tools/export_model.py -c configs/vitdet/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.yml --slim_config _template_pact -o
fpgm_export:tools/export_model.py -c configs/vitdet/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.yml --slim_config _template_fpgm -o
distill_export:null
export1:null
export2:null
kl_quant_export:tools/post_quant.py -c configs/vitdet/cascade_rcnn_vit_base_hrfpn_cae_1x_coco.yml --slim_config configs/slim/post_quant/ppyoloe_crn_s_300e_coco_ptq.yml -o
##
infer_mode:norm|kl_quant
infer_quant:False|True
inference:./deploy/python/infer.py
--device:gpu|cpu
--enable_mkldnn:False
--cpu_threads:4
--batch_size:1|2
--use_tensorrt:null
--run_mode:paddle
--model_dir:
--image_dir:./dataset/coco/test2017/
--save_log_path:null
--run_benchmark:False
--trt_max_shape:1600
===========================train_benchmark_params==========================
batch_size:8
fp_items:fp32|fp16
epoch:1
repeat:12
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:null
===========================infer_benchmark_params===========================
numpy_infer_input:3x640x640.npy
\ No newline at end of file
......@@ -158,6 +158,9 @@ else
if [[ ${model_name} =~ "s2anet" ]]; then
cd ./ppdet/ext_op && eval "${python} setup.py install"
cd ../../
elif [[ ${model_name} =~ "ppyoloe_r_crn_s_3x_spine_coco" ]]; then
cd ./ppdet/ext_op && eval "${python} setup.py install"
cd ../../
fi
# download mot lite data
wget -nc -P ./dataset/mot/ https://paddledet.bj.bcebos.com/data/tipc/mot_tipc.tar --no-check-certificate
......
#!/bin/bash
source test_tipc/utils_func.sh
FILENAME=$1
MODE="pipeline_infer"
# parser model_name
dataline=$(cat ${FILENAME})
IFS=$'\n'
lines=(${dataline})
model_name=$(func_parser_value "${lines[1]}")
echo "ppdet pipeline_python_infer: ${model_name}"
python=$(func_parser_value "${lines[2]}")
filename_key=$(func_parser_key "${lines[3]}")
filename_value=$(func_parser_value "${lines[3]}")
# parser infer params
infer_mode_list=$(func_parser_value "${lines[5]}")
input_key=$(func_parser_key "${lines[6]}")
input_list=$(func_parser_value "${lines[6]}")
use_gpu=$(func_parser_value "${lines[7]}")
inference_py=$(func_parser_value "${lines[8]}")
use_device_key=$(func_parser_key "${lines[9]}")
use_device_list=$(func_parser_value "${lines[9]}")
image_dir_key=$(func_parser_key "${lines[10]}")
infer_img_dir=$(func_parser_value "${lines[10]}")
video_dir_key=$(func_parser_key "${lines[11]}")
infer_video_dir=$(func_parser_value "${lines[11]}")
LOG_PATH="./test_tipc/output/${model_name}/${MODE}"
mkdir -p ${LOG_PATH}
status_log="${LOG_PATH}/results_serving_python.log"
function func_pipeline_inference(){
IFS='|'
_python=$1
_log_path=$2
_pipeline_script=$3
_infer_dir=$4
_input_type=$5
_device_cmd=$6
_device_type=$7
# inference
pipeline_log_path="${_log_path}/python_pipeline_${_input_type}_${_device_type}.log"
output_path="--output_dir=${LOG_PATH}/"
mot_flag="-o MOT.enable=True"
if [ ${_input_type} = "video" ]; then
pipeline_cmd="${_python} ${_pipeline_script} ${_infer_dir} ${_device_cmd} ${output_path} ${mot_flag} > ${pipeline_log_path} 2>&1 &"
else
pipeline_cmd="${_python} ${_pipeline_script} ${_infer_dir} ${_device_cmd} ${output_path} > ${pipeline_log_path} 2>&1 &"
fi
# run
eval $pipeline_cmd
last_status=${PIPESTATUS[0]}
eval "cat ${pipeline_log_path}"
status_check $last_status "${pipeline_cmd}" "${status_log}" "${model_name}" "${pipeline_log_path}"
}
#run infer
Count=0
IFS="|"
for input in ${input_list[*]}; do
for device_type in ${use_device_list[*]};do
# set cuda device
if [ ${use_gpu} = "False" ] || [ ${device_type} = "cpu" ]; then
device_cmd=$(func_set_params "${use_device_key}" "${device_type}")
elif [ ${use_gpu} = "True" ] && [ ${device_type} = "gpu" ]; then
device_cmd=$(func_set_params "${use_device_key}" "${device_type}")
env="export CUDA_VISIBLE_DEVICES=0"
eval $env
else
echo "Does not support hardware other than CPU and GPU Currently!"
fi
if [ ${input} != "null" ]; then
case ${input} in
image) set_infer_file=$(func_set_params "${image_dir_key}" "${infer_img_dir}") ;;
video) set_infer_file=$(func_set_params "${video_dir_key}" "${infer_video_dir}") ;;
*) echo "Undefined input mode!"; exit 1;
esac
fi
#run inference
func_pipeline_inference "${python}" "${LOG_PATH}" "${inference_py}" ${set_infer_file} ${input} ${device_cmd} ${device_type}
Count=$(($Count + 1))
eval "unset CUDA_VISIBLE_DEVICES"
done
done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册