-
Notifications
You must be signed in to change notification settings - Fork 8
/
init.sh
78 lines (64 loc) · 1.63 KB
/
init.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
#!bin/sh
DATASET_FOLDER="data"
verify_checksum() {
local file=$1
local expect_checksum=$2
if [ ! -f "$out_file" ]; then
return 1
fi
local checksum=$(md5sum $file | cut -d' ' -f1)
if [ "$checksum" = "$expect_checksum" ]; then
echo "$file | $checksum | verified"
return 0
else
echo "$file | $checksum | not verified"
rm -f "$file"
return 1
fi
}
download_google_drive_file() {
local file_id=$1
local checksum=$2
local out_file=$3
verify_checksum "$out_file" "$checksum"
if [ $? = 0 ]; then
return 0
fi
curl -L "https://drive.google.com/uc?id=$file_id&export=download" > "$out_file"
verify_checksum "$out_file" "$checksum"
if [ $? = 0 ]; then
return 0
else
echo
echo "$out_file > Checksum verification failed"
return 1
fi
}
# CREATE DATASET FOLDER
if [ ! -d "$DATASET_FOLDER" ]; then
mkdir -v "$DATASET_FOLDER"
fi
cd "$DATASET_FOLDER"
echo
echo "--------- DOWNLOADING TRAINED DATA FOR CRAFT ------------"
download_google_drive_file \
"1Jk4eGD7crsqCCg9C9VjCLkMN3ze8kutZ" \
"2f8227d2def4037cdb3b34389dcf9ec1" \
"craft_mlt_25k.pth"
echo
echo "---------- DOWNLOADING REFINER DATA FOR CRAFT -----------"
download_google_drive_file \
"1XSaFwBkOaFOdtk4Ane3DFyJGPRw6v5bO" \
"3d48f83540567d2a43d2f6ca4b4d9f13" \
"craft_refiner_CTW1500.pth"
echo
echo "---------- DOWNLOADING TRAINED DATA FOR MORAN -----------"
download_google_drive_file \
"1IDvT51MXKSseDq3X57uPjOzeSYI09zip" \
"f1417448c934db65572f9fc261e18f09" \
"moran_v2_demo.pth"
echo
cd ..
echo
echo "READY!"
echo