-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup_submodules.sh
executable file
·105 lines (92 loc) · 3.7 KB
/
setup_submodules.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
#!/bin/bash
# Ensure working dir is at the location of this script
cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null
echo "In order to run EMOCA, you need to download FLAME. Before you continue, you must register and agree to license terms at:"
echo -e '\e]8;;https://flame.is.tue.mpg.de\ahttps://flame.is.tue.mpg.de\e]8;;\a'
while true; do
read -p "I have registered and agreed to the license terms at https://flame.is.tue.mpg.de? (y/n)" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
echo "If you wish to use EMOCA, please register at:"
echo -e '\e]8;;https://emoca.is.tue.mpg.de\ahttps://emoca.is.tue.mpg.de\e]8;;\a'
while true; do
read -p "I have registered and agreed to the license terms at https://emoca.is.tue.mpg.de? (y/n)" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Pulling submodules"
for repo in SMIRK EMOCA
do
echo $repo
# Pull non-recursively & patch
git submodule update --init submodules/$repo &&
(cd submodules/$repo && patch -p1 <../$repo.patch)
done
# Setup EMOCA
(
cd submodules/EMOCA
# git submodule update --init external/SwinTransformer
git submodule update --init --recursive external/spectre
mkdir -p assets &&
cd assets
(
mkdir -p EMOCA/models &&
cd EMOCA/models &&
# EMOCA v2 model
echo -e "\nDownloading EMOCA v2..." &&
wget https://download.is.tue.mpg.de/emoca/assets/EMOCA/models/EMOCA_v2_lr_mse_20.zip -O EMOCA_v2_lr_mse_20.zip &&
unzip EMOCA_v2_lr_mse_20.zip &&
# DECA model
echo -e "\nDownloading DECA..." &&
wget https://download.is.tue.mpg.de/emoca/assets/EMOCA/models/DECA.zip -O DECA.zip &&
unzip DECA.zip &&
rm DECA.zip EMOCA_v2_lr_mse_20.zip
)
(
mkdir -p EmotionRecognition/image_based_networks &&
cd EmotionRecognition/image_based_networks &&
# EmoNet
echo -e "\nDownloading EmoNet..." &&
wget https://download.is.tue.mpg.de/emoca/assets/EmotionRecognition/image_based_networks/ResNet50.zip -O ResNet50.zip &&
unzip ResNet50.zip &&
rm ResNet50.zip
)
echo -e "\nDownloading pretrained FaceRecognition (VGG)..." &&
wget https://download.is.tue.mpg.de/emoca/assets/FaceRecognition.zip -O FaceRecognition.zip &&
unzip FaceRecognition.zip &&
rm FaceRecognition.zip
# Download FLAME for EMOCA (we can't reuse MultiFLARE's here because EMOCA needs more)
echo -e "\nDownloading FLAME assets" &&
wget https://download.is.tue.mpg.de/emoca/assets/FLAME.zip -O FLAME.zip &&
unzip FLAME.zip &&
rm FLAME.zip
cd ../
(
# Spectre / Lip reading loss
echo -e "\nDownloading spectre/lipreading pretrained model..." &&
cd external/spectre &&
gdown 1yHd4QwC7K_9Ro2OM_hC7pKUT2URPvm_f -O LRS3_V_WER32.3.zip &&
unzip LRS3_V_WER32.3.zip -d data/ &&
rm LRS3_V_WER32.3.zip
)
)
# Link EMOCA and DECA configs
ln configs/emoca/cfg_baseline.yaml submodules/EMOCA/assets/EMOCA/models/EMOCA_v2_lr_mse_20/cfg_baseline.yaml
ln configs/emoca/cfg_baseline.yaml submodules/EMOCA/assets/EMOCA/models/DECA/cfg_baseline.yaml
ln configs/emoca/cfg_spark.yaml submodules/EMOCA/assets/EMOCA/models/EMOCA_v2_lr_mse_20/cfg_spark.yaml
# Setup SMIRK
(
echo -e "\nDownloading pretrained SMIRK model..." &&
cd submodules/SMIRK &&
gdown 1T65uEd9dVLHgVw5KiUYL66NUee-MCzoE -O pretrained_models/
# Link SMIRK's FLAME to EMOCA's to avoid downloading it twice
mkdir -p assets/FLAME2020 &&
ln ../EMOCA/assets/FLAME/geometry/generic_model.pkl assets/FLAME2020/generic_model.pkl
)