-
Notifications
You must be signed in to change notification settings - Fork 4
/
track_evaluation_ensemble.sh
executable file
·96 lines (82 loc) · 3.89 KB
/
track_evaluation_ensemble.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
#default parameter
param="threshold"
start=50
end=50
step=10
# date_list=(0902_190000_191900 0903_150000_151900 0903_190000_191900 0924_150000_151900 \
# 0924_190000_191900 0925_150000_151900 0925_190000_191900 1015_150000_151900 1015_190000_191900)
date_list=(0902_150000_151900 0903_150000_151900 0924_150000_151900 0925_150000_151900 1015_150000_151900)
model_list=(resnet101_ibn_a resnext101_ibn_a densenet169_ibn_a se_resnet101_ibn_a swin_reid)
visualize=False
while getopts “p:s:e:t:d:?” argv
do
case $argv in
p)
param=$OPTARG
;;
s)
start=$OPTARG
;;
e)
end=$OPTARG
;;
t)
step=$OPTARG
;;
d)
time=$OPTARG
;;
?)
usage
exit
;;
esac
done
if [ $time == "m" ]
then
date_list=(0902_150000_151900 0903_150000_151900 0924_150000_151900 0925_150000_151900 1015_150000_151900)
else
date_list=(0902_190000_191900 0903_190000_191900 0924_190000_191900 0925_190000_191900 1015_190000_191900)
fi
for cam in {0..7}
do
for((i=$start;i<=$end;i+=step))
do
for date in "${date_list[@]}";
do
if [ $param == "threshold" ]
then
Label_from=""
else
Label_from="YoloV8_"
fi
for model in "${model_list[@]}";
do
# Start tracking the cars on the monitor.
echo python main.py -f ../../IMAGE/$date -l ../../LABEL/"$Label_from""$date" --$param $i --out dist_matrix/"${date}_${param}_${i}" --cam $cam --finetune True --model $model --output_ensemble True
python main.py -f ../../IMAGE/"${date}" -l ../../LABEL/"$Label_from""$date" --$param $i --out dist_matrix/"${date}_${param}_${i}" --cam $cam --finetune True --model $model --output_ensemble True
done
echo python ensemble.py -f ../../IMAGE/$date -l ../../LABEL/"$Label_from""$date" --$param $i --out aicup_ts_ensemble/labels/"${date}_${param}_${i}" --cam $cam --dist_dir dist_matrix --finetune True
python ensemble.py -f ../../IMAGE/$date -l ../../LABEL/"$Label_from""$date" --$param $i --out aicup_ts_ensemble/labels/"${date}_${param}_${i}" --cam $cam --dist_dir dist_matrix --finetune True
# Confirm whether the ground truth file exists.
if ! [ -d MOT15/aicup_gt/$date ]
then
echo python parseAicup.py -s aicup_gt/labels/$date -l ../../LABEL/$date/
python parseAicup.py -s aicup_gt/labels/$date -l ../../LABEL/$date/
echo python tools/datasets/AICUP_to_MOT15.py --AICUP_dir aicup_gt/labels/$date --MOT15_dir MOT15/aicup_gt/$date
python tools/datasets/AICUP_to_MOT15.py --AICUP_dir aicup_gt/labels/$date --MOT15_dir MOT15/aicup_gt/$date
fi
# Convert the results from AICUP format to MOT15 format.
echo python tools/datasets/AICUP_to_MOT15.py --AICUP_dir aicup_ts_ensemble/labels/"${date}_${param}_${i}"/$cam --MOT15_dir MOT15/aicup_ts_ensemble/"${date}_${param}_${i}"
python tools/datasets/AICUP_to_MOT15.py --AICUP_dir aicup_ts_ensemble/labels/"${date}_${param}_${i}"/$cam --MOT15_dir MOT15/aicup_ts_ensemble/"${date}_${param}_${i}"
# Evaluate the result.
echo python tools/evaluate.py --gt_dir MOT15/aicup_gt/$date --ts_dir MOT15/aicup_ts_ensemble/"${date}_${param}_${i}" --mode single_cam --cam $cam --ensemble True
python tools/evaluate.py --gt_dir MOT15/aicup_gt/$date --ts_dir MOT15/aicup_ts_ensemble/"${date}_${param}_${i}" --mode single_cam --cam $cam --ensemble True
done
done
done
for cam in {0..7}
do
python calculate_ave_performance.py -f ts_result_ensemble/ -p "${param}" --start $start --end $end --step $step --cam $cam --ensemble True --time $time
done