#!/bin/bash
get_file_path() {
echo $1
for file in $1/*
do
if [ -f $file ]
then
echo $file
echo $file >> $dir
else
get_file_path $file
fi
done
}
all_waring="all_warning.txt"
mv $all_waring all_warning.txt_last
touch $all_waring
run_logic() {
echo "Dir:$1"
if [ -d $1 ]
then
rm -r json_output
rm -r images
rm images.txt
rm json_output.txt
fcw_file="fcw_result_triggered.txt"
if [ -f ${fcw_file} ];then
rm $fcw_file
fi
json_path="$1/json_output"
echo $json_path
mkdir json_output
for file in $json_path/*
do
cp -r $file json_output/
done
json_file_path="json_output"
for file in $json_file_path/*
do
echo $file >> "json_output.txt"
done
image_path="${1#*/}"
image_path="03_10_fcw_data/${image_path}"
echo $image_path
mkdir images
for file in $image_path/*
do
cp -r $file images/
done
rm images/*.txt
images_file_path="images"
for file in $images_file_path/*
do
echo $file >> "images.txt"
done
rm "serialize_output.json"
python ../merge_json.py --list_path json_output.txt --save_file serialize_output.json
echo "--------------------------"
LD_LIBRARY_PATH=../thirdparty/glog/lib:install/lib-ffmpeg:install/liba4 ./benchmark/display_living --image_list ./images.txt --video_info ./serialize_output.json --adas_config_file ../thirdparty/resource/config/adas_config_a4_test.json --model_file install/model/adas.tar --camera_file install/camera_config/a4_adas_camera_config.json --flc_config_file install/config/fcp_config_x86.json --video_out 3.avi --font_path install/font/default_font.ttc --sdk_config_file install/config/adas_sdk_config.json --debug_mode 63
mv 3.avi $1
# touch fcw_result_triggered.txt
if [ -f ${fcw_file} ];then
echo "----------- triggered warning -----------------------"
echo $1 >> $all_waring
cat $fcw_file >> $all_waring
echo "---------------" >> $all_waring
mv $fcw_file $1
fi
else
echo "$1 is not dir"
fi
}
dataline=$(cat ./video_list.txt)
for file in $dataline
do
run_logic $file
sleep 1
echo "==============================="
done
获取文件路径并进行处理
最新推荐文章于 2022-07-16 21:14:35 发布