-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_git_modules.sh
executable file
·80 lines (63 loc) · 2.32 KB
/
install_git_modules.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
#!/usr/bin/env bash
# ====================================================
# import the utils
. bash_utils.sh
# ====================================================
#set -e
STARTING_DIR=`pwd` # this should be the main folder directory of the repo
print_blue '================================================'
print_blue "Checking and downloading git modules ..."
set_git_modules
# download d2net models
print_blue '================================================'
print_blue "Checking and downloading d2net models ..."
cd thirdparty/d2net
make_dir models
if [ ! -f models/d2_ots.pth ]; then
echo downloading d2net model
wget https://dsmn.ml/files/d2-net/d2_ots.pth -O models/d2_ots.pth
wget https://dsmn.ml/files/d2-net/d2_tf.pth -O models/d2_tf.pth
wget https://dsmn.ml/files/d2-net/d2_tf_no_phototourism.pth -O models/d2_tf_no_phototourism.pth
fi
cd $STARTING_DIR
# download contextdesc models
print_blue '================================================'
print_blue "Checking and downloading contextdesc models ..."
cd thirdparty/contextdesc
touch __init__.py
make_dir pretrained
cd pretrained
if [ ! -d retrieval_model ]; then
wget https://research.altizure.com/data/contextdesc_models/contextdesc_pp.tar
tar -xvf contextdesc_pp.tar
rm contextdesc_pp.tar
wget https://research.altizure.com/data/contextdesc_models/retrieval_model.tar
tar -xvf retrieval_model.tar
rm retrieval_model.tar
fi
cd $STARTING_DIR
# download lfnet models
print_blue '================================================'
print_blue "Checking and downloading lfnet models ..."
cd thirdparty
# copy local changes
rsync ./lfnet_changes/inference.py ./lfnet/inference.py
# download pretrained model
cd lfnet
touch __init__.py
make_dir pretrained
if [ ! -d pretrained/lfnet-norotaug ]; then
wget https://www.cs.ubc.ca/research/kmyi_data/files/2018/lf-net/lfnet-norotaug.tar.gz -O pretrained/lfnet-norotaug.tar.gz
tar -C pretrained/ -xf pretrained/lfnet-norotaug.tar.gz
fi
cd $STARTING_DIR
# setting keynet
print_blue '================================================'
print_blue "Setting keynet ..."
cd thirdparty
# copy local changes
rsync ./keynet_changes/keynet_architecture.py ./keynet/keyNet/model/keynet_architecture.py
cd $STARTING_DIR
# install delf
./install_delf.sh
cd $STARTING_DIR