File size: 8,770 Bytes
4b9a54c
4fa5f0d
4b9a54c
4fa5f0d
4b9a54c
 
4fa5f0d
4b9a54c
 
 
 
 
4fa5f0d
4b9a54c
 
 
 
4fa5f0d
4b9a54c
4fa5f0d
4b9a54c
 
 
4fa5f0d
4b9a54c
4fa5f0d
 
 
 
4b9a54c
 
4fa5f0d
 
4b9a54c
 
 
 
 
4fa5f0d
4b9a54c
4fa5f0d
4b9a54c
4fa5f0d
4b9a54c
 
 
 
4fa5f0d
4b9a54c
 
 
 
 
4fa5f0d
4b9a54c
4fa5f0d
4b9a54c
 
4fa5f0d
 
 
 
 
 
 
4b9a54c
 
 
4fa5f0d
 
4b9a54c
4fa5f0d
 
4b9a54c
 
 
 
 
4fa5f0d
 
 
 
 
 
4b9a54c
 
4fa5f0d
 
 
4b9a54c
 
 
4fa5f0d
4b9a54c
4fa5f0d
 
4b9a54c
 
 
 
4fa5f0d
4b9a54c
 
 
 
 
4fa5f0d
4b9a54c
 
4fa5f0d
4b9a54c
4fa5f0d
4b9a54c
4fa5f0d
4b9a54c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4fa5f0d
4b9a54c
4fa5f0d
4b9a54c
4fa5f0d
 
4b9a54c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4fa5f0d
 
4b9a54c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# PhysInOne Rendered Data Download

## Choose your data

PhysInOne provides three separate public releases. Choose the guide that matches
the resources you need:

| Release | Contents | Download guide |
| --- | --- | --- |
| **1. Rendered Data** | Released Train and Val scene archives containing rendered observations and annotations | **This guide** |
| **2. 3D Assets** | Unreal Engine project files, asset libraries, Scenes, and Trajectories | [3D Assets: download and project setup](https://huggingface.co/datasets/vLAR/PhysInOne/blob/main/Utils/3D_ASSETS_DOWNLOAD.md) |
| **3. Leaderboard Evaluation Data** | Public inputs for Video Generation, Future Prediction, Physical Properties Estimation, and Motion Transfer; private ground truth is excluded | [Leaderboard: task inputs and download commands](https://huggingface.co/datasets/vLAR/PhysInOne/blob/main/Utils/LEADERBOARD_DOWNLOAD.md) |

The instructions below cover **Rendered Data only**. Use `filter_cases.py` to
select scenes, then `download_selected.py` to download their archives.
`download_data.py --task all` covers the separate 3D Assets and Leaderboard
releases; it does **not** download the full rendered dataset.

## Requirements and tools

- Python 3.9 or newer and Git for the setup command below.
- Enough disk space for the scene archives you select.
- No Python package installation, account, or authentication is required.

Clone the repository and run all commands from its root:

```bash
git clone https://github.com/vLAR-group/PhysInOne.git
cd PhysInOne
python scripts/filter_cases.py --help
python scripts/download_selected.py --help
```

The tools are also available under [Hugging Face `Utils/scripts/`](https://huggingface.co/datasets/vLAR/PhysInOne/tree/main/Utils/scripts).
Keep the script directory together: `download_selected.py` imports shared
functions from `download_data.py`, and both the scene index and repository map
are supplied under `scripts/download_lists/`. These are local dependencies;
the scripts do not install packages or fetch supporting scripts at runtime.

## Full rendered dataset selection

### Where the data is stored

| Split | Remote location | Selection |
| --- | --- | --- |
| Train | The 16 shard repositories listed on the [dataset homepage](https://huggingface.co/datasets/vLAR/PhysInOne#dataset-repositories) | `--split train` |
| Val | The main repository's [Val directory](https://huggingface.co/datasets/vLAR/PhysInOne/tree/main/Val) | `--split val` |

The bundled index lists the available scenes; the repository map resolves their
download locations automatically. Selection counts reflect that bundled index,
not a live scan of Hugging Face. Update your checkout when new data is released.
The released Val archive count is separate from the 103-scene Future Prediction
Leaderboard task.

### Example A: select and download a Train subset

This example selects up to 100 double-physics scenes containing `FrictionStop`.
The seed makes the selection reproducible for the same index.

```bash
python scripts/filter_cases.py \
  --split train \
  --activity_type double \
  --phenomena FrictionStop \
  --num 100 \
  --seed 42 \
  --output selected_train_cases.json \
  --show_stats
```

Preview the selection's download destinations:

```bash
python scripts/download_selected.py \
  --selection selected_train_cases.json \
  --output-dir ./PhysInOne_data/rendered_data \
  --keep-shard-structure \
  --dry-run
```

Download the selected archives:

```bash
python scripts/download_selected.py \
  --selection selected_train_cases.json \
  --output-dir ./PhysInOne_data/rendered_data \
  --keep-shard-structure
```

To select all indexed Train scenes, use `--split train` without
`--activity_type`, `--phenomena`, or `--num`. Preview the resulting selection
before starting a large download.

### Example B: select and download all indexed Val scenes

```bash
python scripts/filter_cases.py \
  --split val \
  --output selected_val_cases.json \
  --show_stats

python scripts/download_selected.py \
  --selection selected_val_cases.json \
  --output-dir ./PhysInOne_data/rendered_data \
  --keep-shard-structure
```

Use `val`, not `valid`. Add `--dry-run` to the download command to preview the
transfers. The selection command writes JSON only and does not download images.

## Selection options

These options belong to `filter_cases.py`:

| Option | Meaning |
| --- | --- |
| `--split train` / `--split val` | Select a rendered-data split. Omitting this option includes all indexed splits. |
| `--activity_type single` / `double` / `triple` | Filter by physical-interaction complexity. |
| `--phenomena NAME [NAME ...]` | Filter using phenomenon abbreviations, such as `FrictionStop`. |
| `--match_mode contains` | Require all requested phenomena; allow additional phenomena. This is the default. |
| `--match_mode exact` | Require exactly the requested set of phenomena. |
| `--num N` | Randomly select at most N matching scenes. Omit to keep all matches. |
| `--seed N` | Random sampling seed. Default: `42`. |
| `--output PATH` | Selection JSON destination. Default: `selected_cases.json`. |
| `--show_stats` | Print selected counts by split, complexity, and repository-map key. |
| `--assignment_file PATH` | Use a custom scene index. Default: `scripts/download_lists/repo_assignment.txt`. |

The parser also accepts `--split test`, but it only searches the scene index.
It is not a way to download the four Leaderboard task packages; use the
[Leaderboard guide](https://huggingface.co/datasets/vLAR/PhysInOne/blob/main/Utils/LEADERBOARD_DOWNLOAD.md) for those inputs.

## Download options

These options belong to `download_selected.py`:

| Option | Meaning |
| --- | --- |
| `--selection PATH` | Read the selection JSON. Default: `selected_cases.json`. |
| `--output-dir PATH` | Set a local output root without whitespace. The examples use `./PhysInOne_data/rendered_data`; the script default is `PhysInOne_data/full_dataset`. |
| `--keep-shard-structure` | Preserve repository-map key, split, and physics category directories. Without this option, ZIPs go directly into the output root. |
| `--workers N` | Concurrent downloads. Default: `4`. |
| `--retries N` | Retries after a failed request. Default: `3`. |
| `--timeout SECONDS` | Request timeout. Default: `60`. |
| `--revision REV` | Remote repository revision. Default: `main`. |
| `--no-resume` | Restart incomplete `.part` files instead of resuming. |
| `--overwrite` | Download again even when a completed local file exists. |
| `--dry-run` | Show the transfer count and up to 20 planned paths without downloading. |
| `--repo-map PATH` | Use a custom repository map. Default: `scripts/download_lists/repo_map.json`. |

## Downloaded files and logs

With `--keep-shard-structure`, the example commands produce this layout:

```text
PhysInOne_data/
└── rendered_data/
    β”œβ”€β”€ physinone_part1/
    β”‚   └── Train/
    β”‚       └── DoublePhysics/
    β”‚           └── <scene>_trajectory.zip
    β”œβ”€β”€ ...
    β”œβ”€β”€ physinone_val/
    β”‚   └── Val/
    β”‚       └── <Physics>/
    β”‚           └── <scene>_trajectory.zip
    └── _download_logs/
        └── YYYYMMDD_HHMMSS/
            β”œβ”€β”€ downloads.tsv
            β”œβ”€β”€ failures.tsv
            └── summary.json
```

Only directories needed by your selection are created. `physinone_val` is the
local repository-map key for Val data hosted in the main HF repository.

`download_selected.py` keeps the downloaded scene ZIPs compressed; it does not
automatically extract them. Extract the archives you need with a ZIP tool,
preserving their internal scene and camera directories. Its options differ from
the separate `download_data.py` used for 3D Assets and Leaderboard inputs.

Interactive terminals display file progress, transferred size, speed, and an
estimated remaining time. Redirected output uses periodic text updates. Use
`downloads.tsv`, `failures.tsv`, and `summary.json` to review individual files
and the overall result.

## Resume and troubleshooting

- Run the same download command again to reuse completed files and resume
  incomplete `.part` files. Files are renamed to their final names after download.
- If a completed ZIP needs replacement, use `--overwrite`.
- For a slow or rate-limited connection, lower concurrency with `--workers 2`.
- If a filter matches zero cases, check the spelling (`val`, not `valid`),
  update your checkout, and check that the requested scenes are included in
  `scripts/download_lists/repo_assignment.txt`.
- Keep `filter_cases.py`, `download_selected.py`, `download_data.py`, and
  `download_lists/` from the same release so that selection and repository
  mapping stay consistent.