vLAR commited on
Commit
4fa5f0d
Β·
verified Β·
1 Parent(s): a570982

Fix validation data selection and downloads

Browse files
Utils/DATA_DOWNLOAD.md ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PhysInOne Public Data Download
2
+
3
+ The PhysInOne public downloader retrieves the released Leaderboard inputs and
4
+ released 3D assets from the public `vLAR/PhysInOne` dataset repository. It
5
+ uses only the Python standard library and anonymous HTTPS requests.
6
+
7
+ Ground-truth outputs for the Leaderboard are private and are not included.
8
+
9
+ ## Requirements
10
+
11
+ - Python 3.9 or newer
12
+ - Enough free disk space for the selected release
13
+ - Unreal Engine 5.5.4 when using the 3D asset project
14
+
15
+ No Python package installation or account configuration is required.
16
+
17
+ ## Get the downloader
18
+
19
+ Clone the GitHub repository and run the script from the project root:
20
+
21
+ ```bash
22
+ git clone https://github.com/vLAR-group/PhysInOne.git
23
+ cd PhysInOne
24
+ python scripts/download_data.py --help
25
+ ```
26
+
27
+ The maintained download lists are stored in `scripts/download_lists/`. The
28
+ script reads them locally and does not fetch utility files at runtime. A
29
+ byte-identical public mirror of the complete script tree is maintained under
30
+ [`Utils/scripts/`](https://huggingface.co/datasets/vLAR/PhysInOne/tree/main/Utils/scripts).
31
+
32
+ ## Progress display
33
+
34
+ Interactive terminals show a single live progress bar with completed file count,
35
+ transferred and estimated total size, current download speed, and ETA. The total
36
+ size and ETA are marked as estimates because public manifests do not store object
37
+ sizes; they become more accurate as Hugging Face responses provide file sizes.
38
+ When output is redirected to a log, the downloader automatically writes periodic
39
+ plain-text snapshots instead of terminal control characters. Per-file success and
40
+ failure details are always retained under `_download_logs/`.
41
+
42
+ ## Quick start
43
+
44
+ Download all four public Leaderboard tasks:
45
+
46
+ ```bash
47
+ python scripts/download_data.py \
48
+ --task video_generation future_prediction \
49
+ physical_properties_estimation motion_transfer \
50
+ --output-dir ./PhysInOne_data
51
+ ```
52
+
53
+ Download one task:
54
+
55
+ ```bash
56
+ python scripts/download_data.py \
57
+ --task future_prediction \
58
+ --output-dir ./PhysInOne_data
59
+ ```
60
+
61
+ Download and assemble all currently released 3D assets:
62
+
63
+ ```bash
64
+ python scripts/download_data.py \
65
+ --task 3d_assets \
66
+ --output-dir ./PhysInOne_data
67
+ ```
68
+
69
+ ZIP extraction is enabled by default for `3d_assets`. Leaderboard ZIP files
70
+ remain compressed unless `--extract` is specified.
71
+
72
+ ## Task values
73
+
74
+ | `--task` value | Released public content | File count |
75
+ | --- | --- | ---: |
76
+ | `video_generation` | Initial frames, camera metadata, and captions | 75,865 |
77
+ | `future_prediction` | Fixed-view input sequences and split metadata | 103 ZIP files |
78
+ | `physical_properties_estimation` | Scene inputs and shared supplementary files | 72 scene ZIP files plus 2 shared files |
79
+ | `motion_transfer` | Source videos, reference frames, and captions | 214 ZIP files |
80
+ | `3d_assets` | Unreal Engine project assets for 14,847 Val and 120,660 Train scenes | 4,585 files |
81
+ | `all` | Every item above | 80,841 files |
82
+
83
+ Multiple task values can follow one `--task` option. Hyphenated names and the
84
+ short aliases shown by `--help` are also accepted.
85
+
86
+ ## Command-line options
87
+
88
+ | Option | Description |
89
+ | --- | --- |
90
+ | `--task NAME [NAME ...]` | Select one or more tasks, or `all`. |
91
+ | `--output-dir PATH` | Set the local output root. The path must not contain whitespace. |
92
+ | `--scene TEXT` | Keep paths containing a scene name or six-character scene ID. Repeatable. |
93
+ | `--workers N` | Set concurrent downloads. Default: `4`. |
94
+ | `--revision REV` | Select a dataset revision. Default: `main`. |
95
+ | `--retries N` | Set retries after each failed request. Default: `3`. |
96
+ | `--timeout SECONDS` | Set the timeout for each network request. Default: `60`. |
97
+ | `--extract` | Safely validate and extract selected ZIP files. |
98
+ | `--no-extract` | Keep all ZIP files compressed, including 3D asset archives. |
99
+ | `--delete-zip-after-extract` | Remove a ZIP only after successful extraction. |
100
+ | `--no-resume` | Restart incomplete `.part` files instead of resuming. |
101
+ | `--force` | Replace completed local downloads. |
102
+ | `--list-only` | Print the selected public URLs and exit. |
103
+ | `--dry-run` | Show counts and output locations without downloading. |
104
+
105
+ ## Examples
106
+
107
+ Download Video Generation inputs:
108
+
109
+ ```bash
110
+ python scripts/download_data.py \
111
+ --task video_generation \
112
+ --output-dir ./PhysInOne_data
113
+ ```
114
+
115
+ Download and extract Future Prediction inputs:
116
+
117
+ ```bash
118
+ python scripts/download_data.py \
119
+ --task future_prediction \
120
+ --extract \
121
+ --output-dir ./PhysInOne_data
122
+ ```
123
+
124
+ Download selected Motion Transfer scenes by ID:
125
+
126
+ ```bash
127
+ python scripts/download_data.py \
128
+ --task motion_transfer \
129
+ --scene B15ta6 \
130
+ --scene 7omQio \
131
+ --output-dir ./PhysInOne_data
132
+ ```
133
+
134
+ Preview Physical Properties Estimation without downloading:
135
+
136
+ ```bash
137
+ python scripts/download_data.py \
138
+ --task physical_properties_estimation \
139
+ --dry-run \
140
+ --output-dir ./PhysInOne_data
141
+ ```
142
+
143
+ Download 3D assets and remove archives after verified extraction:
144
+
145
+ ```bash
146
+ python scripts/download_data.py \
147
+ --task 3d_assets \
148
+ --delete-zip-after-extract \
149
+ --output-dir ./PhysInOne_data
150
+ ```
151
+
152
+ ## Full rendered dataset selection
153
+
154
+ The repository also includes a filter and downloader for selecting scene
155
+ archives from the public rendered dataset. Train archives are distributed
156
+ across 16 shard repositories, while the currently released Val archives are
157
+ stored in the main `vLAR/PhysInOne` dataset repository. The bundled index and
158
+ repository map handle this difference automatically.
159
+
160
+ Create a selection file:
161
+
162
+ ```bash
163
+ python scripts/filter_cases.py \
164
+ --split train \
165
+ --activity_type double \
166
+ --phenomena FrictionStop \
167
+ --num 100 \
168
+ --output selected_cases.json
169
+ ```
170
+
171
+ Select all currently released Val archives:
172
+
173
+ ```bash
174
+ python scripts/filter_cases.py \
175
+ --split val \
176
+ --output selected_val_cases.json \
177
+ --show_stats
178
+ ```
179
+
180
+ This currently selects 199 Val scene archives. The count follows the public
181
+ files present under `Val/` and may increase as additional validation data is
182
+ released.
183
+
184
+ Download the selected archives:
185
+
186
+ ```bash
187
+ python scripts/download_selected.py \
188
+ --selection selected_cases.json \
189
+ --output-dir ./PhysInOne_data/full_dataset \
190
+ --keep-shard-structure
191
+ ```
192
+
193
+ `filter_cases.py` reads the bundled
194
+ `scripts/download_lists/repo_assignment.txt` index. `download_selected.py`
195
+ reads the bundled `repo_map.json` and uses the same anonymous, resumable HTTPS
196
+ implementation as the task downloader.
197
+
198
+ | Selection option | Description |
199
+ | --- | --- |
200
+ | `--split train|val|test` | Filter by dataset split. |
201
+ | `--activity_type single|double|triple` | Filter by interaction complexity. |
202
+ | `--phenomena NAME [NAME ...]` | Require one or more physical phenomena. |
203
+ | `--match_mode contains|exact` | Control phenomenon matching. |
204
+ | `--num N` | Randomly sample at most `N` matching cases. |
205
+ | `--seed N` | Set the sampling seed. |
206
+ | `--output PATH` | Write the selection JSON. |
207
+
208
+ | Selected-download option | Description |
209
+ | --- | --- |
210
+ | `--selection PATH` | Read a selection JSON produced by `filter_cases.py`. |
211
+ | `--output-dir PATH` | Set the whitespace-free archive destination. |
212
+ | `--keep-shard-structure` | Preserve part, split, and activity directories. |
213
+ | `--workers N` | Set concurrent downloads. |
214
+ | `--retries N` | Set retries after a failed request. |
215
+ | `--no-resume` | Restart incomplete `.part` files. |
216
+ | `--overwrite` | Replace completed local archives. |
217
+ | `--dry-run` | Preview transfers without downloading. |
218
+
219
+ ## Local directory layout
220
+
221
+ All directories created by the downloader have names without spaces:
222
+
223
+ ```text
224
+ PhysInOne_data/
225
+ β”œβ”€β”€ leaderboard/
226
+ β”‚ β”œβ”€β”€ video_generation/
227
+ β”‚ β”œβ”€β”€ future_prediction/
228
+ β”‚ β”œβ”€β”€ physical_properties_estimation/
229
+ β”‚ └── motion_transfer/
230
+ β”œβ”€β”€ 3d_assets/
231
+ β”‚ └── PhysicBenchmark/
232
+ └── _download_logs/
233
+ └── YYYYMMDD_HHMMSS/
234
+ β”œβ”€β”€ downloads.tsv
235
+ β”œβ”€β”€ extractions.tsv
236
+ β”œβ”€β”€ failures.tsv
237
+ └── summary.json
238
+ ```
239
+
240
+ Published object paths are URL-encoded by the maintained lists. The downloader
241
+ maps them to the no-space local layout above, so shell commands do not require
242
+ special quoting for task directories.
243
+
244
+ ## Resume and verification
245
+
246
+ Downloads are written to `.part` files and renamed atomically after completion.
247
+ Run the same command again to reuse completed files and resume incomplete ones.
248
+ Use `--force` only when a completed local file must be replaced.
249
+
250
+ ZIP archives are checked for unsafe paths, symbolic links, and CRC errors before
251
+ extraction. A completion marker is written only after successful extraction.
252
+ Detailed progress and failures are recorded under `_download_logs/`.
253
+
254
+ For slower or rate-limited networks, reduce concurrency:
255
+
256
+ ```bash
257
+ python scripts/download_data.py \
258
+ --task all \
259
+ --workers 2 \
260
+ --output-dir ./PhysInOne_data
261
+ ```
262
+
263
+ ## 3D asset setup
264
+
265
+ The completed public release contains Unreal Engine 5.5.4 resources for 14,847
266
+ validation scenes and 120,660 training scenes, together with the released Train
267
+ and Val resource libraries. The download contains 4,585 files and 285 ZIP
268
+ archives (approximately 139.67 GiB before extraction). The 273 validation
269
+ origins reserved for the Motion Transfer test set are intentionally excluded to
270
+ prevent evaluation leakage. The release also includes ten Movie Render Queue
271
+ configurations at `Content/PhysInOne/Scripts/`, corresponding to
272
+ `/Game/PhysInOne/Scripts/` in Unreal Engine. Windows is recommended for the
273
+ simplest setup; Linux is also supported with additional Unreal Engine
274
+ configuration.
275
+
276
+ Every 3D asset ZIP is extracted in place into its current parent directory. The
277
+ Scene and Trajectory archives are deliberately kept separate:
278
+
279
+ | Archive pattern | ZIP member layout | Result after extraction |
280
+ | --- | --- | --- |
281
+ | `Content/PhysInOne/Scenes/val_scenes_batch_*.zip` | `Val/<Physics>/<Scene>.umap` | `Content/PhysInOne/Scenes/Val/<Physics>/<Scene>.umap` |
282
+ | `Content/PhysInOne/Scenes/train_scenes_batch_*.zip` | `Train/<Physics>/<Scene>.umap` | `Content/PhysInOne/Scenes/Train/<Physics>/<Scene>.umap` |
283
+ | `Content/PhysInOne/Trajectories/val_trajectory_batch_*.zip` | `Val/<Physics>/<Scene>_trajectory.uasset` | `Content/PhysInOne/Trajectories/Val/<Physics>/<Scene>_trajectory.uasset` |
284
+ | `Content/PhysInOne/Trajectories/train_trajectory_batch_*.zip` | `Train/<Physics>/<Scene>_trajectory.uasset` | `Content/PhysInOne/Trajectories/Train/<Physics>/<Scene>_trajectory.uasset` |
285
+
286
+ The Train Scene and Trajectory series each span batches `0000–0120`; the Val
287
+ series each span batches `0000–0014`. The final Train batch contains 660
288
+ scenes, and the final Val batch contains 847 scenes.
289
+
290
+ The Train and Val ZIP files can therefore share the same remote directory
291
+ without colliding: their members begin with different split directories.
292
+
293
+ After the default 3D asset download finishes, launch:
294
+
295
+ ```text
296
+ PhysInOne_data/assets/PhysicBenchmark/PhysInOne.uproject
297
+ ```
298
+
299
+ Do not rename directories inside `PhysicBenchmark/`. Unreal Engine resolves
300
+ assets by project-relative package paths, including `BackGrounds_raw`,
301
+ `__ExternalActors__`, and `__ExternalObjects__`.
Utils/metadata/repo_assignment.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:380a0ba378cd4c2e89b1fc6b6c26c5adf01e65f2c1c1a0c62862d360c47091ab
3
- size 21608478
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:266ba0fec1c14e9990ef87c243cd715dd90c5b8235ab71faebbe8a03a4f6bff1
3
+ size 21640129
Utils/metadata/repo_map.json CHANGED
@@ -14,5 +14,6 @@
14
  "physinone_part13": "PhysInOneP13/PhysInOneP13",
15
  "physinone_part14": "PhysInOneP14/PhysInOneP14",
16
  "physinone_part15": "PhysInOneP15/PhysInOneP15",
17
- "physinone_part16": "PhysInOneP16/PhysInOneP16"
 
18
  }
 
14
  "physinone_part13": "PhysInOneP13/PhysInOneP13",
15
  "physinone_part14": "PhysInOneP14/PhysInOneP14",
16
  "physinone_part15": "PhysInOneP15/PhysInOneP15",
17
+ "physinone_part16": "PhysInOneP16/PhysInOneP16",
18
+ "physinone_val": "vLAR/PhysInOne"
19
  }
Utils/scripts/download_lists/repo_assignment.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:380a0ba378cd4c2e89b1fc6b6c26c5adf01e65f2c1c1a0c62862d360c47091ab
3
- size 21608478
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:266ba0fec1c14e9990ef87c243cd715dd90c5b8235ab71faebbe8a03a4f6bff1
3
+ size 21640129
Utils/scripts/download_lists/repo_map.json CHANGED
@@ -14,5 +14,6 @@
14
  "physinone_part13": "PhysInOneP13/PhysInOneP13",
15
  "physinone_part14": "PhysInOneP14/PhysInOneP14",
16
  "physinone_part15": "PhysInOneP15/PhysInOneP15",
17
- "physinone_part16": "PhysInOneP16/PhysInOneP16"
 
18
  }
 
14
  "physinone_part13": "PhysInOneP13/PhysInOneP13",
15
  "physinone_part14": "PhysInOneP14/PhysInOneP14",
16
  "physinone_part15": "PhysInOneP15/PhysInOneP15",
17
+ "physinone_part16": "PhysInOneP16/PhysInOneP16",
18
+ "physinone_val": "vLAR/PhysInOne"
19
  }
Utils/scripts/filter_cases.py CHANGED
@@ -11,8 +11,8 @@ The script parses:
11
  phenomena: abbreviations before "__bg..."
12
  background: bgXXX
13
  hash: final six-character code
14
- part_id: e.g. physinone_part1
15
- hf_zip_path: expected zip path inside the shard repo, e.g.
16
  Train/DoublePhysics/AccelConcaveSpin_AccelSurfaceSpin__bg070__K5ER39_trajectory.zip
17
  """
18
 
 
11
  phenomena: abbreviations before "__bg..."
12
  background: bgXXX
13
  hash: final six-character code
14
+ part_id: repository-map key, e.g. physinone_part1 or physinone_val
15
+ hf_zip_path: expected zip path inside the mapped dataset repository, e.g.
16
  Train/DoublePhysics/AccelConcaveSpin_AccelSurfaceSpin__bg070__K5ER39_trajectory.zip
17
  """
18