This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.sh
87 lines (73 loc) · 2.49 KB
/
setup.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
#!/bin/sh
echo "!! This program will set up everything you need to use Facenet !!"
echo " "
echo "-- Installing requirements.txt"
echo " "
pip3 install --upgrade pip
pip3 install -r requirements.txt --user
if [ ! -f "model/20170512-110547.zip" ]
then
echo "-- Facenet zip does not already exists in model folder, downloading."
rm -f ./cookies.txt
touch ./cookies.txt
wget --load-cookies ./cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies ./cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=0B5MzpY9kBtDVZ2RpVDYwWmxoSUk' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=0B5MzpY9kBtDVZ2RpVDYwWmxoSUk" -O model/20170512-110547.zip && rm -rf ./cookies.txt
else
echo "-- Facenet zip already exists in model folder"
fi
if [ ! -f "model/20170512-110547" ]
then
echo "-- Facenet zip not unzipped, unzipping."
cd model
unzip 20170512-110547.zip
cd ../
else
echo "-- Facenet zip already unzipped."
fi
if [ ! -f "model/inception_resnet_v1.py" ]
then
echo "-- Inception Resnet does not already exists in model folder, downloading."
cd model
wget -c --no-cache -P . https://raw.githubusercontent.com/davidsandberg/facenet/361c501c8b45183b9f4ad0171a9b1b20b2690d9f/src/models/inception_resnet_v1.py -O inception_resnet_v1.py
sed -i 's/\r//' *.py
chmod +x *.py
cd ../
else
echo "-- Inception Resnet already exists in model folder."
fi
cd model/20170512-110547
if [ ! -e facenet_celeb.data-00000-of-00001 ]
then
mv model-20170512-110547.ckpt-250000.data-00000-of-00001 facenet_celeb.data-00000-of-00001
else
echo "-- data file exists"
fi
if [ ! -e facenet_celeb.index ]
then
mv model-20170512-110547.ckpt-250000.index facenet_celeb.index
else
echo "-- index file exists"
fi
if [ ! -e facenet_celeb.meta ]
then
mv model-20170512-110547.meta facenet_celeb.meta
else
echo "-- meta file exists"
fi
if [ ! -e facenet_celeb_ncs ]
then
echo "-- Converted directory does not exist, doing conversion"
python3.5 ../convert_facenet.py model_base=facenet_celeb
else
echo "-- Converted directory exists, skipping conversion. "
fi
cd ../../
if [ -e tass.graph ]
then
echo "-- Graph file exists, skipping compilation."
else
echo "-- Compiling graph file."
cd model/20170512-110547/facenet_celeb_ncs
mvNCCompile facenet_celeb_ncs.meta -w facenet_celeb_ncs -s 12 -in input -on output -o tass.graph
cp tass.graph ../..
cd ../../../
fi