-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
executable file
·137 lines (116 loc) · 3.64 KB
/
install.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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
# system dependencies:
# apt-get install python-pip python-dev python-virtualenv protobuf-compiler python-pil python-lxml python-dev git
printf "\033[1;33mWould you like to install the GPU version of tensorflow? (Y/n)\033[0m\n"
read tf_gpu
if [ "$tf_gpu" == "Y" -o "$tf_gpu" == "y" ]
then
echo "going to download gpu versions of models"
gpu=1
else
echo "going to download cpu versions of models"
unset gpu
fi
DIR=$PWD
# install our requirements in the platform venv
source $VIRTUAL_ENV/bin/activate
cd `dirname $0`
pip install -r requirements.txt
deactivate
cd $HBP/GazeboRosPackages/src
# install embodied attention model
if [ -d embodied_attention ]; then
cd embodied_attention
git pull origin master
cd ..
else
git clone https://github.com/HBPNeurorobotics/embodied_attention.git
fi
cd embodied_attention/attention
pip install --user -e .
cd ..
mkdir -p model
cd model
# download saliency model
download_saliency () {
if [ $1 ]; then
curl -k -o model.ckpt.meta "https://neurorobotics-files.net/index.php/s/tpbnsKfZdWwfbJa/download"
curl -k -o model.ckpt.index "https://neurorobotics-files.net/index.php/s/3FT8J4sqfcqqHi4/download"
curl -k -o model.ckpt.data-00000-of-00001 "https://neurorobotics-files.net/index.php/s/oBYnPs6xoyYPitA/download"
echo "gpu" > config
else
curl -k -o model.ckpt.meta "https://neurorobotics-files.net/index.php/s/kRcjnp4qcHysb5y/download"
curl -k -o model.ckpt.index "https://neurorobotics-files.net/index.php/s/528KwtbR6xe3Kds/download"
curl -k -o model.ckpt.data-00000-of-00001 "https://neurorobotics-files.net/index.php/s/HZ4a8QWsFkFR9Xr/download"
echo "cpu" > config
fi
}
current_setup=`cat config`
if [ -z $current_setup ]; then
download_saliency $gpu
elif [ $current_setup == "gpu" ] && [ $gpu ]; then
echo "GPU weights already present"
elif [ $current_setup == "cpu" ] && [ -z $gpu ]; then
echo "CPU weights already present"
else
download_saliency $gpu
fi
cd $HBP/GazeboRosPackages/src
# install memory model
if [ -d holographic ]; then
cd holographic
git pull origin master
cd ..
else
git clone https://github.com/HBPNeurorobotics/holographic.git
fi
cd holographic/vsa
pip install --user -e .
cd $HBP/Models/
# install world and poster models
if [ -d CDP4_models ]; then
cd CDP4_models
git pull origin master
cd ..
else
git clone https://github.com/HBPNeurorobotics/CDP4_models.git
fi
./create-symlinks.sh
cd $HBP/GazeboRosPackages/
catkin_make
# install tensorflow
cd $HOME/.opt
if [ ! -d tensorflow_venv ]
then
virtualenv --system-site-packages tensorflow_venv
source tensorflow_venv/bin/activate
if [ $gpu ]; then
pip install --upgrade tensorflow-gpu==1.6.0
else
pip install --upgrade tensorflow==1.6.0
fi
deactivate
fi
# install object detection models
if [ -d models ]; then
cd models
git pull origin master
else
git clone https://github.com/tensorflow/models
cd models
fi
# for some reason, protoc can not compile the most recent version of the files
git checkout c31b3c2
cd research
protoc object_detection/protos/*.proto --python_out=.
if [ ! -d $HOME/.opt/graph_def ]
then
# install pretrained models
mkdir -p $HOME/.opt/graph_def
cd /tmp
curl -OL http://download.tensorflow.org/models/object_detection/faster_rcnn_resnet101_coco_11_06_2017.tar.gz
tar -xzf faster_rcnn_resnet101_coco_11_06_2017.tar.gz faster_rcnn_resnet101_coco_11_06_2017/frozen_inference_graph.pb
cp -a faster_rcnn_resnet101_coco_11_06_2017 $HOME/.opt/graph_def/
ln -sf $HOME/.opt/graph_def/faster_rcnn_resnet101_coco_11_06_2017/frozen_inference_graph.pb $HOME/.opt/graph_def/frozen_inference_graph.pb
fi
cd $DIR