forked from eglxiang/ytf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compuFea1.sh
36 lines (34 loc) · 1.13 KB
/
compuFea1.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
# Xiang Xiang (eglxiang@gmail.com), June 6, 2016, MIT license.
# Bash processing YFW: computing deep features.
# Call VGG_Face_seq to process a single sequence. You need to explicitly call the binary (either release or debug mode) such as ./bin/Release/classify_test VGG_FACE_deploy.prototxt VGG_FACE.caffemodel $arg3 where arg3 is the argument defined in the bash.
#!/bin/bash
shopt -s dotglob
inputroot=".../YouTubeFaces/selected_faces/" # input folder path
outputroot=".../YouTubeFaces/features/" # output folder path
for dir in "$inputroot"*/
do
echo "$dir"
pename=${dir#$inputroot} # parameter substitution
echo "$pename"
#outdir=$outputroot$pename
#mkdir $outdir # comment if output directory have been created
for subdir in "$dir"*/
do
echo "$subdir"
idname=${subdir#$dir}
echo "$idname"
#outsubdir=$outputroot$pename/$idname
#mkdir $outsubdir
arg3=${subdir#$inputroot}
echo "$arg3"
for file in "$subdir"*
do
if [[ -f $file ]]
then
#echo "$file"
./classify_test VGG_FACE_deploy.prototxt VGG_FACE.caffemodel $arg3
# note that arg3 is the argument variable defined above.
fi
done
done
done