-
Notifications
You must be signed in to change notification settings - Fork 336
/
install_delf.sh
executable file
·58 lines (42 loc) · 1.67 KB
/
install_delf.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
#!/usr/bin/env bash
# ====================================================
# import the utils
. bash_utils.sh
# ====================================================
STARTING_DIR=`pwd` # this should be the main folder directory of the repo
#set -e
# N.B.: this must be run after having run the script install_git_modules.sh
print_blue '================================================'
print_blue "Installing delf ..."
cd thirdparty
make_dir protoc
cd protoc
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [ ! -f protoc-3.3.0-linux-x86_64.zip ]; then
echo 'installing protoc'
wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
unzip protoc-3.3.0-linux-x86_64.zip
fi
PATH_TO_PROTOC=`pwd`/bin/protoc
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
PROTOC_ZIP=protoc-3.7.1-osx-x86_64.zip
if [ ! -f $PROTOC_ZIP ]; then
echo 'installing protoc'
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
fi
PATH_TO_PROTOC=/usr/local/bin/protoc
fi
cd $STARTING_DIR
cd thirdparty/tensorflow_models/research/delf
${PATH_TO_PROTOC} delf/protos/*.proto --python_out=.
PARAMETERS_DIR=delf/python/examples/parameters/
mkdir -p $PARAMETERS_DIR
if [ ! -f $PARAMETERS_DIR/delf_gld_20190411.tar.gz ]; then
echo 'downloading delf model'
wget http://storage.googleapis.com/delf/delf_gld_20190411.tar.gz -O $PARAMETERS_DIR/delf_gld_20190411.tar.gz
tar -C $PARAMETERS_DIR -xvf $PARAMETERS_DIR/delf_gld_20190411.tar.gz
fi
cd $STARTING_DIR