-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathrun.sh
executable file
·67 lines (59 loc) · 1.42 KB
/
run.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
#!/usr/bin/env bash
#author: huangyangyu
mode=feature
#mode=model
dataset=LFW
#dataset=YTF
if [ $# -eq 2 ]; then
mode=$1
dataset=$2
fi
echo "mode: ${mode}, dataset: ${dataset}"
#step 1: git clone https://github.com/ydwen/caffe-face.git
#Done
#step 2: compile caffe
if [ ! -d caffe/build/ ]; then
echo "compiling caffe"
cd caffe
mkdir build
cd build
cmake ..
make -j32
make pycaffe
cd ../..
fi
#step 3: download model and testing dataset, then unzip them
if [ "$mode" = "feature" ]; then
# feature
cd data/${dataset}
feature_file=feature_${dataset}.tar.gz
if [ ! -f "${feature_file}" ]; then
echo "downloading feature file"
wget http://imgserver.yunshitu.cn/extra/user/huangyangyu/${feature_file}
tar -zxf ${feature_file}
fi
cd -
else
# model
cd model
model_file=ResNet-27.tar.gz
if [ ! -f "${model_file}" ]; then
echo "downloading model file"
wget http://imgserver.yunshitu.cn/extra/user/huangyangyu/${model_file}
tar -zxf ${model_file}
fi
cd -
# dataset
cd data/${dataset}
data_file=${dataset}.tar.gz
if [ ! -f "$data_file" ]; then
echo "downloading data file"
wget http://imgserver.yunshitu.cn/extra/user/huangyangyu/${data_file}
tar -zxf ${data_file}
fi
cd -
fi
#step 4: run evaluate.py in LFW or YTF directory
cd code/${dataset}
python evaluate.py
cd -