-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgo.sh
More file actions
120 lines (98 loc) · 3.45 KB
/
go.sh
File metadata and controls
120 lines (98 loc) · 3.45 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/bash
function yolol(){
for l in `ls $1`
do
python3 ~/yoloface/yoloface.py --image $1"/"$l --output-dir ~/data/yolol/
done
}
function yolor(){
for r in `ls $1`
do
python3 ~/yoloface/yoloface.py --image $1"/"$r --output-dir ~/data/yolor/
done
}
function yoloc(){
for c in `ls $1`
do
python3 ~/yoloface/yoloface.py --image $1"/"$c --output-dir ~/data/yoloc/
done
}
function yolo(){
for c in `ls $1`
do
python3 ~/yoloface/yoloface.py --image $1"/"$c --output-dir ~/test2
done
}
function chang(){
a=1
cd $1
for p in `ls $1`
do
mv $p $a".jpg"
a=`expr $a + 1`
done
}
function read_dir(){
for file in `ls $1`
do
if [ -d $1"/"$file ]
then
read_dir $1"/"$file
else
echo $1"/"$file
roslaunch center.launch bag:=$1"/"$file
killall -9 roslaunch
sleep 5s
mv /home/z/.ros/*.jpg ~/data/c
roslaunch left.launch bag:=$1"/"$file
killall -9 roslaunch
sleep 5s
mv /home/z/.ros/*.jpg ~/data/l
roslaunch right.launch bag:=$1"/"$file
killall -9 roslaunch
sleep 5s
mv /home/z/.ros/*.jpg ~/data/r
#Get the picture sequence of the three groups of front cameras
yoloc ~/data/c
yolol ~/data/l
yolor ~/data/r
#Face coding sike processing on three sets of picture sequences
rosrun BtoP BtoP $1"/"$file
rosrun btop btop $1"/"$file
#Obtain a sequence of pictures for the two rear cameras, and then perform face mosaic processing
cd alpr-unconstrained
make
bash run.sh -i ~/data/left -o ~/data/left2 -c ~/data/left2/results.csv
rm ~/data/left/*
bash run.sh -i ~/data/right -o ~/data/right2 -c ~/data/right2/results.csv
rm ~/data/right/*
bash run.sh -i ~/data/yolol -o ~/data/okl -c ~/data/okl/results.csv
bash run.sh -i ~/data/yoloc -o ~/data/okc -c ~/data/okc/results.csv
bash run.sh -i ~/data/yolor -o ~/data/okr -c ~/data/okr/results.csv
rm ~/data/yolol/*
rm ~/data/yoloc/*
rm ~/data/yolor/*
chang ~/data/okc
chang ~/data/okl
chang ~/data/okr
cd ..
#After processing the face mosaic of the five groups of pictures, process the license plate mosaic of the five groups of pictures
echo $1"/"$file
echo ~/_$file
rosrun PtoB PtoB $1"/"$file ~/_$file
rosrun ptob ptob $1"/"$file ~/_$file
#Re-record 5 groups of processed pictures into a rosbag
rm ~/data/r/*
rm ~/data/l/*
rm ~/data/c/*
rm *.jpg
rm ~/data/left2/*
rm ~/data/right2/*
rm ~/data/okc/*
rm ~/data/okl/*
rm ~/data/okr/*
#Delete intermediate data
fi
done
}
read_dir $1