forked from google-deepmind/deepmind-research
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdownload.sh
More file actions
executable file
·178 lines (163 loc) · 5.38 KB
/
Copy pathdownload.sh
File metadata and controls
executable file
·178 lines (163 loc) · 5.38 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#!/bin/bash
# Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Use this script to download the sketchy dataset.
#
# You will need to extract the archive files before using them. Each archive
# (except for the last in each group) contains 100 episodes.
if [ -z "$1" ]; then
echo "Usage: $(basename "$0") download_folder" >&2
exit 1
fi
DOWNLOAD_FOLDER="$1"
NUM_PARALLEL_DOWNLOADS="4" # set the number of download workers
DATA_URL="https://storage.googleapis.com/sketchy-data"
function download_shards {
# Usage: download_shards prefix num_shards
local PREFIX="$1"
local LIMIT="$(printf "%05d" "$2")"
# Avoid leading zeros or this will be interpreted as an octal number.
local MAX="$(("$2"-1))"
(
for IDX in $(seq -f'%05.0f' 0 "$MAX"); do
echo "${PREFIX}-${IDX}-of-${LIMIT}.tar.bz2"
done
) | xargs -I{} -n1 -P"${NUM_PARALLEL_DOWNLOADS}" \
curl "${DATA_URL}/{}" --output "${DOWNLOAD_FOLDER}/{}"
}
# This is the metadata. This file is small, you always want it.
curl "${DATA_URL}/metadata.sqlite" --output "${DOWNLOAD_FOLDER}/metadata.sqlite"
# Download these files if you want all and only the episodes with an associated
# reward sequence.
#
# sqlite3 metadata.sqlite <<EOF
# SELECT DISTINCT(Episodes.DataPath)
# FROM Episodes, RewardSequences
# WHERE Episodes.EpisodeId = RewardSequences.EpisodeId
# EOF
#
# If you are downloading the full dataset then you do not need these files. The
# episodes they contain are included in the other subsets.
#
# download_shards episodes_with_rewards 58
# These files contain a curated set of high quality demonstrations for the
# lift_green task.
#
# sqlite3 metadata.sqlite <<EOF
# SELECT Episodes.DataPath
# FROM Episodes, EpisodeTags
# WHERE EpisodeTags.Tag='lift_green__demos'
# AND Episodes.EpisodeId = EpisodeTags.EpisodeId
# EOF
#
download_shards lift_green__demos 2
# These files contain a broader set of episodes for the lift_green task. If you
# download these you should also download the lift_green__demos files.
#
# sqlite3 metadata.sqlite <<EOF
# SELECT Episodes.DataPath
# FROM Episodes, EpisodeTags
# WHERE EpisodeTags.Tag='lift_green__episodes'
# AND Episodes.EpisodeId = EpisodeTags.EpisodeId
# AND EpisodeTags.EpisodeId NOT IN (
# SELECT ET.EpisodeId
# FROM EpisodeTags AS ET
# WHERE ET.Tag IN ('lift_green__demos')
# )
# EOF
#
download_shards lift_green__episodes 70
# These files contain a curated set of high quality demonstrations for the
# stack_green_on_red task.
#
# sqlite3 metadata.sqlite <<EOF
# SELECT Episodes.DataPath
# FROM Episodes, EpisodeTags
# WHERE EpisodeTags.Tag='stack_green_on_red__demos'
# AND Episodes.EpisodeId = EpisodeTags.EpisodeId
# AND EpisodeTags.EpisodeId NOT IN (
# SELECT ET.EpisodeId
# FROM EpisodeTags AS ET
# WHERE ET.Tag IN ('lift_green__demos', 'lift_green__episodes')
# )
# EOF
#
download_shards stack_green_on_red__demos 2
# These files contain a broader set of episodes for the stack_green_on_red task.
# If you download these you should also download the stack_green_on_red__demos
# files.
#
# sqlite3 metadata.sqlite <<EOF
# SELECT Episodes.DataPath
# FROM Episodes, EpisodeTags
# WHERE EpisodeTags.Tag='stack_green_on_red__episodes'
# AND Episodes.EpisodeId = EpisodeTags.EpisodeId
# AND EpisodeTags.EpisodeId NOT IN (
# SELECT ET.EpisodeId
# FROM EpisodeTags AS ET
# WHERE ET.Tag IN (
# 'lift_green__demos',
# 'lift_green__episodes',
# 'stack_green_on_red__demos')
# )
# EOF
#
download_shards stack_green_on_red__episodes 101
# These files contain a large variety of episodes using the same object set as
# the lift_green and stack_green_on_red tasks. There are many tasks represented
# here, and the episode quality is highly variable.
#
# sqlite3 metadata.sqlite <<EOF
# SELECT Episodes.DataPath
# FROM Episodes, EpisodeTags
# WHERE EpisodeTags.Tag='rgb30__all'
# AND Episodes.EpisodeId = EpisodeTags.EpisodeId
# AND EpisodeTags.EpisodeId NOT IN (
# SELECT ET.EpisodeId
# FROM EpisodeTags AS ET
# WHERE ET.Tag IN (
# 'lift_green__demos',
# 'lift_green__episodes',
# 'stack_green_on_red__demos',
# 'stack_green_on_red__episodes')
# )
# EOF
#
download_shards rgb30__all 205
# These files contain a broad set of episodes for the pull_cloth_up task.
#
# sqlite3 metadata.sqlite <<EOF
# SELECT Episodes.DataPath
# FROM Episodes, EpisodeTags
# WHERE EpisodeTags.Tag='pull_cloth_up__episodes'
# AND Episodes.EpisodeId = EpisodeTags.EpisodeId
# EOF
#
download_shards pull_cloth_up__episodes 133
# These files contain a large variety of episodes using the same object set as
# the pull_cloth_up task.
#
# sqlite3 metadata.sqlite <<EOF
# SELECT Episodes.DataPath
# FROM Episodes, EpisodeTags
# WHERE EpisodeTags.Tag='deform8__all'
# AND Episodes.EpisodeId = EpisodeTags.EpisodeId
# AND EpisodeTags.EpisodeId NOT IN (
# SELECT ET.EpisodeId
# FROM EpisodeTags AS ET
# WHERE ET.Tag IN ('pull_cloth_up__episodes')
# )
# EOF
#
download_shards deform8__all 233