fix eval bug and inference path
This commit is contained in:
parent
ef0467884e
commit
58ca7639fc
|
@ -48,7 +48,7 @@ for train_model in ${train_model_list[*]}; do
|
||||||
yml_file="configs/det/det_mv3_db.yml"
|
yml_file="configs/det/det_mv3_db.yml"
|
||||||
wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar
|
wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar
|
||||||
cd ./inference && tar xf ch_det_data_50.tar && cd ../
|
cd ./inference && tar xf ch_det_data_50.tar && cd ../
|
||||||
img_dir="./inference/ch_det_data_50/"
|
img_dir="./inference/ch_det_data_50/all-sum-50"
|
||||||
elif [ ${train_model} = "ocr_rec" ];then
|
elif [ ${train_model} = "ocr_rec" ];then
|
||||||
model_name="rec"
|
model_name="rec"
|
||||||
yml_file="configs/rec/rec_mv3_none_bilstm_ctc.yml"
|
yml_file="configs/rec/rec_mv3_none_bilstm_ctc.yml"
|
||||||
|
@ -102,12 +102,13 @@ for train_model in ${train_model_list[*]}; do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
save_log_path="${log_path}/${eval_model_name}"
|
save_log_path="${log_path}/${eval_model_name}"
|
||||||
command="${python} tools/eval.py -c ${yml_file} -o Global.pretrained_model="${eval_model_name}/best_accuracy" Global.save_model_dir=${save_log_path}"
|
eval_img="Eval.dataset.data_dir=./inference/ch_det_data_50/ Eval.dataset.label_file_list=./inference/ch_det_data_50/test_gt_50.txt"
|
||||||
${python} tools/eval.py -c ${yml_file} -o Global.pretrained_model="${eval_model_name}/best_accuracy" Global.save_model_dir=${save_log_path}
|
command="${python} tools/eval.py -c ${yml_file} -o Global.pretrained_model='${eval_model_name}/best_accuracy' Global.save_model_dir=${save_log_path} ${eval_img}"
|
||||||
|
${python} tools/eval.py -c ${yml_file} -o Global.pretrained_model='./inference/${eval_model_name}/best_accuracy' Global.save_model_dir=${save_log_path} ${eval_img}
|
||||||
status_check $? "${trainer}" "${command}" "${status_log}"
|
status_check $? "${trainer}" "${command}" "${status_log}"
|
||||||
|
|
||||||
command="${python} tools/export_model.py -c ${yml_file} -o Global.pretrained_model="${eval_model_name}/best_accuracy" Global.save_inference_dir=${log_path}/${eval_model_name}_infer Global.save_model_dir=${save_log_path}"
|
command="${python} tools/export_model.py -c ${yml_file} -o Global.pretrained_model="${eval_model_name}/best_accuracy" Global.save_inference_dir=${log_path}/${eval_model_name}_infer Global.save_model_dir=${save_log_path}"
|
||||||
${python} tools/export_model.py -c ${yml_file} -o Global.pretrained_model="${eval_model_name}/best_accuracy" Global.save_inference_dir="${log_path}/${eval_model_name}_infer" Global.save_model_dir=${save_log_path}
|
${python} tools/export_model.py -c ${yml_file} -o Global.pretrained_model="./inference/${eval_model_name}/best_accuracy" Global.save_inference_dir="${log_path}/${eval_model_name}_infer" Global.save_model_dir=${save_log_path}
|
||||||
status_check $? "${trainer}" "${command}" "${status_log}"
|
status_check $? "${trainer}" "${command}" "${status_log}"
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
@ -119,11 +120,11 @@ for train_model in ${train_model_list[*]}; do
|
||||||
if [ "${model_name}" = "det" ]; then
|
if [ "${model_name}" = "det" ]; then
|
||||||
export rec_batch_size_list=( "1" )
|
export rec_batch_size_list=( "1" )
|
||||||
inference="tools/infer/predict_det.py"
|
inference="tools/infer/predict_det.py"
|
||||||
det_model_dir=${log_path}/${eval_model_name}_infer
|
det_model_dir="./inference/${log_path}/${eval_model_name}_infer"
|
||||||
rec_model_dir=""
|
rec_model_dir=""
|
||||||
elif [ "${model_name}" = "rec" ]; then
|
elif [ "${model_name}" = "rec" ]; then
|
||||||
inference="tools/infer/predict_rec.py"
|
inference="tools/infer/predict_rec.py"
|
||||||
rec_model_dir=${log_path}/${eval_model_name}_infer
|
rec_model_dir="./inference/${log_path}/${eval_model_name}_infer"
|
||||||
det_model_dir=""
|
det_model_dir=""
|
||||||
fi
|
fi
|
||||||
# inference
|
# inference
|
||||||
|
|
Loading…
Reference in New Issue