-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfetch_data.sh
49 lines (35 loc) · 1.08 KB
/
fetch_data.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
#!/bin/bash
#
# Fetch Omniglot and Mini-ImageNet.
# Orig. Ref: https://github.com/openai/supervised-reptile/blob/master/fetch_data.sh
#
OMNIGLOT_URL=https://raw.githubusercontent.com/brendenlake/omniglot/master/python
set -e
mkdir tmp
trap 'rm -r tmp' EXIT
if [ ! -d data ]; then
mkdir data
fi
if [ ! -d data/omniglot ]; then
mkdir tmp/omniglot
mkdir data/omniglot
for name in images_background images_evaluation; do
echo "Fetching omniglot/$name ..."
curl -s "$OMNIGLOT_URL/$name.zip" > "tmp/$name.zip"
echo "Extracting omniglot/$name ..."
unzip -q "tmp/$name.zip" -d tmp
rm "tmp/$name.zip"
mv tmp/$name/* tmp/omniglot
done
mkdir data/omniglot/data
mkdir data/omniglot/splits
mv tmp/omniglot/* data/omniglot/data
# download data split
export fileid=1xSUHZur5Q7iZ_K9w9fEPmAG_wW_o5_vY
export filename=vinyals.zip
curl -L -o $filename 'https://docs.google.com/uc?export=download&id='$fileid
unzip $filename
rm $filename
mv vinyals data/omniglot/splits/
mkdir model_saves/
fi