Spaces:
Runtime error
Runtime error
Upload download.sh
Browse files- src/scripts/download.sh +78 -0
src/scripts/download.sh
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env sh
|
2 |
+
|
3 |
+
|
4 |
+
# set -euo pipefail
|
5 |
+
|
6 |
+
|
7 |
+
asset_dir="./assets"
|
8 |
+
|
9 |
+
[ ! -e "${asset_dir}"/models_smplx_v1_1.zip ] \
|
10 |
+
&& echo Error: Download SMPL-X body model from https://smpl-x.is.tue.mpg.de \
|
11 |
+
and save zip archive to "${asset_dir}" \
|
12 |
+
&& exit 1 \
|
13 |
+
&& :
|
14 |
+
|
15 |
+
asset_urls=(
|
16 |
+
# Download constants (SPIN)
|
17 |
+
http://visiondata.cis.upenn.edu/spin/data.tar.gz
|
18 |
+
|
19 |
+
# Download essentials (SMPLify-XMC)
|
20 |
+
https://download.is.tue.mpg.de/tuch/smplify-xmc-essentials.zip
|
21 |
+
|
22 |
+
# Download sketch2pose models
|
23 |
+
http://www-labs.iro.umontreal.ca/~bmpix/sketch2pose/models.zip
|
24 |
+
|
25 |
+
# Download test images
|
26 |
+
http://www-labs.iro.umontreal.ca/~bmpix/sketch2pose/images.zip
|
27 |
+
)
|
28 |
+
for asset_url in "${asset_urls[@]}"; do
|
29 |
+
wget \
|
30 |
+
-nc \
|
31 |
+
-c \
|
32 |
+
--directory-prefix "${asset_dir}" \
|
33 |
+
"${asset_url}"
|
34 |
+
done
|
35 |
+
|
36 |
+
models_dir="./models"
|
37 |
+
mkdir -p "${models_dir}"
|
38 |
+
|
39 |
+
model_files=(
|
40 |
+
# Unzip smplx models
|
41 |
+
models_smplx_v1_1.zip
|
42 |
+
|
43 |
+
# Unzip essentials (SMPLifu-XMC)
|
44 |
+
smplify-xmc-essentials.zip
|
45 |
+
|
46 |
+
# Unzip sketch2pose models
|
47 |
+
models.zip
|
48 |
+
)
|
49 |
+
|
50 |
+
for model_file in "${model_files[@]}"; do
|
51 |
+
unzip \
|
52 |
+
-u \
|
53 |
+
-d "${models_dir}" \
|
54 |
+
"${asset_dir}"/"${model_file}"
|
55 |
+
done
|
56 |
+
|
57 |
+
# Unzip constants (SPIN)
|
58 |
+
tar \
|
59 |
+
--skip-old-files \
|
60 |
+
-xvf "${asset_dir}"/data.tar.gz \
|
61 |
+
-C "${models_dir}" \
|
62 |
+
data/smpl_mean_params.npz
|
63 |
+
|
64 |
+
data_dir="./data"
|
65 |
+
mkdir -p "${data_dir}"
|
66 |
+
|
67 |
+
# Unzip test images
|
68 |
+
unzip \
|
69 |
+
-u \
|
70 |
+
-d "${data_dir}" \
|
71 |
+
"${asset_dir}"/images.zip
|
72 |
+
|
73 |
+
data_dir="./output"
|
74 |
+
mkdir -p "${data_dir}"
|
75 |
+
unzip \
|
76 |
+
-u \
|
77 |
+
-d "${data_dir}" \
|
78 |
+
"${asset_dir}"/output.zip
|