Upload README.md
Browse files
README.md
CHANGED
|
@@ -148,7 +148,7 @@ homepage: https://vlar-group.github.io/PhysInOne.html
|
|
| 148 |
<strong>🧭 Navigation</strong><br><br>
|
| 149 |
<a href="#summary">📌 Summary</a><br>
|
| 150 |
<a href="#release-timetable">🚀 Release Timetable</a><br>
|
| 151 |
-
<a href="#how-to-
|
| 152 |
<a href="#dataset-structure">📦 Dataset Structure</a><br>
|
| 153 |
<a href="#data-splits">📊 Data Splits</a><br>
|
| 154 |
<a href="#data-fields">🧩 Data Fields</a><br>
|
|
@@ -215,136 +215,6 @@ Due to the large scale of PhysInOne, the rendered data and annotations are split
|
|
| 215 |
|
| 216 |
For large-scale downloading and filtering, please refer to the **How to Use** section below.
|
| 217 |
|
| 218 |
-
<a id="how-to-use"></a>
|
| 219 |
-
|
| 220 |
-
## 📥 How to Use
|
| 221 |
-
|
| 222 |
-
PhysInOne is distributed across multiple Hugging Face dataset repositories because of its large scale. We provide two scripts for selecting and downloading cases:
|
| 223 |
-
|
| 224 |
-
- `filter_cases.py`: parses the case-to-repository assignment file and exports selected cases to JSON.
|
| 225 |
-
- `download.py`: downloads the selected case zip files from the corresponding Hugging Face shard repositories.
|
| 226 |
-
|
| 227 |
-
The `filter_cases.py` script supports selection by:
|
| 228 |
-
|
| 229 |
-
- **Split**: `train`, `val`, `test`
|
| 230 |
-
- **Activity complexity**: `single`, `double`, `triple`
|
| 231 |
-
- **Physical phenomenon abbreviation**: `MovingHitsFixed`, `FrictionStop`, `LiquidTension`, ..., `GranularFall`
|
| 232 |
-
- **Number of cases**: globally sample `num` cases after filtering
|
| 233 |
-
|
| 234 |
-
## 1. Download Scripts
|
| 235 |
-
|
| 236 |
-
Please download the `assets` folder, which contains:
|
| 237 |
-
|
| 238 |
-
```text
|
| 239 |
-
metadata/
|
| 240 |
-
repo_assignment.txt
|
| 241 |
-
repo_map.json
|
| 242 |
-
scripts/
|
| 243 |
-
filter_cases.py
|
| 244 |
-
download.py
|
| 245 |
-
```
|
| 246 |
-
|
| 247 |
-
## 2. Install Dependencies
|
| 248 |
-
|
| 249 |
-
```bash
|
| 250 |
-
pip install huggingface_hub tqdm
|
| 251 |
-
```
|
| 252 |
-
|
| 253 |
-
## 3. Filter Cases
|
| 254 |
-
|
| 255 |
-
### 3.1 Filter by split
|
| 256 |
-
|
| 257 |
-
```bash
|
| 258 |
-
python scripts/filter_cases.py \
|
| 259 |
-
--split train \
|
| 260 |
-
--output selected_cases.json
|
| 261 |
-
```
|
| 262 |
-
|
| 263 |
-
### 3.2 Filter by split and activity complexity
|
| 264 |
-
|
| 265 |
-
```bash
|
| 266 |
-
python scripts/filter_cases.py \
|
| 267 |
-
--split train \
|
| 268 |
-
--activity_type double \
|
| 269 |
-
--output selected_cases.json
|
| 270 |
-
```
|
| 271 |
-
|
| 272 |
-
### 3.3 Filter by physical phenomenon abbreviation
|
| 273 |
-
|
| 274 |
-
By default, phenomenon matching uses `contains` mode. For example, the following command selects all double-physics cases that contain `FrictionStop`:
|
| 275 |
-
|
| 276 |
-
```bash
|
| 277 |
-
python scripts/filter_cases.py \
|
| 278 |
-
--split train \
|
| 279 |
-
--activity_type double \
|
| 280 |
-
--phenomena FrictionStop \
|
| 281 |
-
--match_mode contains \
|
| 282 |
-
--output selected_cases.json
|
| 283 |
-
```
|
| 284 |
-
|
| 285 |
-
For exact matching, use `--match_mode exact`. Order does not matter. For example, this command selects cases whose phenomenon set is exactly `{AccelConcaveSpin, AccelSurfaceSpin}`:
|
| 286 |
-
|
| 287 |
-
```bash
|
| 288 |
-
python scripts/filter_cases.py \
|
| 289 |
-
--split train \
|
| 290 |
-
--activity_type double \
|
| 291 |
-
--phenomena AccelConcaveSpin AccelSurfaceSpin \
|
| 292 |
-
--match_mode exact \
|
| 293 |
-
--output selected_cases.json
|
| 294 |
-
```
|
| 295 |
-
|
| 296 |
-
### 3.4 Randomly sample a fixed number of cases
|
| 297 |
-
|
| 298 |
-
`--num` is the global number of cases sampled after filtering. The default random seed is `42`.
|
| 299 |
-
|
| 300 |
-
```bash
|
| 301 |
-
python scripts/filter_cases.py \
|
| 302 |
-
--split train \
|
| 303 |
-
--activity_type double \
|
| 304 |
-
--phenomena FrictionStop \
|
| 305 |
-
--num 3000 \
|
| 306 |
-
--seed 42 \
|
| 307 |
-
--output selected_cases.json
|
| 308 |
-
```
|
| 309 |
-
|
| 310 |
-
## 4. Download Selected Cases
|
| 311 |
-
|
| 312 |
-
Each selected case is downloaded as a zip file from the corresponding Hugging Face shard repository.
|
| 313 |
-
|
| 314 |
-
```bash
|
| 315 |
-
python scripts/download.py \
|
| 316 |
-
--selection selected_cases.json \
|
| 317 |
-
--output_dir ./PhysInOne
|
| 318 |
-
```
|
| 319 |
-
|
| 320 |
-
If the dataset repositories are gated or private, pass a Hugging Face token:
|
| 321 |
-
|
| 322 |
-
```bash
|
| 323 |
-
python scripts/download.py \
|
| 324 |
-
--selection selected_cases.json \
|
| 325 |
-
--output_dir ./PhysInOne \
|
| 326 |
-
--token YOUR_HF_TOKEN
|
| 327 |
-
```
|
| 328 |
-
|
| 329 |
-
By default, downloaded zip files are saved into a flat output folder. To preserve shard/split/activity structure:
|
| 330 |
-
|
| 331 |
-
```bash
|
| 332 |
-
python scripts/download.py \
|
| 333 |
-
--selection selected_cases.json \
|
| 334 |
-
--output_dir ./PhysInOne \
|
| 335 |
-
--keep_shard_structure
|
| 336 |
-
```
|
| 337 |
-
|
| 338 |
-
The preserved structure is:
|
| 339 |
-
|
| 340 |
-
```text
|
| 341 |
-
PhysInOne/
|
| 342 |
-
physinone_part1/
|
| 343 |
-
Train/
|
| 344 |
-
DoublePhysics/
|
| 345 |
-
AccelConcaveSpin_AccelSurfaceSpin__bg070__K5ER39_trajectory.zip
|
| 346 |
-
```
|
| 347 |
-
|
| 348 |
<a id="dataset-structure"></a>
|
| 349 |
|
| 350 |
## 📦 Dataset Structure
|
|
@@ -460,7 +330,7 @@ This naming convention allows users to quickly parse scene metadata and link it
|
|
| 460 |
|
| 461 |
<a id="annotation-details"></a>
|
| 462 |
|
| 463 |
-
|
| 464 |
|
| 465 |
PhysInOne provides synchronized visual and physical annotations for each dynamic 3D scene.
|
| 466 |
|
|
@@ -475,7 +345,7 @@ Segmentation masks encode background, static foreground objects, and dynamic for
|
|
| 475 |
Expected encoding:
|
| 476 |
|
| 477 |
| Pixel Value | Meaning |
|
| 478 |
-
| -----------
|
| 479 |
| `0` | Background |
|
| 480 |
| `1-127` | Static foreground objects |
|
| 481 |
| `128-255` | Dynamic foreground objects |
|
|
@@ -492,20 +362,20 @@ TODO
|
|
| 492 |
|
| 493 |
Each scene includes multiple camera viewpoints to support 3D perception, reconstruction, and physics-based visual reasoning tasks.
|
| 494 |
|
| 495 |
-
- **Taichi-based MPM simulations** (elastic solids, plasticine, granular substances, some Newtonian and Non-Newtonian fluids): 15 static cameras + 1 dynamic camera
|
| 496 |
-
- **Other scenes**: 12 static cameras + 1 dynamic camera
|
| 497 |
|
| 498 |
**Camera JSON structure** (per camera):
|
| 499 |
|
| 500 |
-
- `frames`: list of per-frame 4×4 camera-to-world (C2W) transformation matrices in **Blender coordinate system**
|
| 501 |
-
- `camera_angle_x`: horizontal field of view (FOV) in radians, can be used to compute intrinsic focal length
|
| 502 |
-
- `img_w`, `img_h`: image width and height in pixels
|
| 503 |
-
- `trajectory_name`: name of the camera trajectory
|
| 504 |
- `total_frames`, `fps`: number of frames and frames per second
|
| 505 |
|
| 506 |
**Dynamic camera behavior**:
|
| 507 |
|
| 508 |
-
- The dynamic camera moves along a path randomly sampled on a hemisphere surrounding the center of the main objects, providing diverse viewpoints.
|
| 509 |
- JSON frame indices correspond directly to video frame indices.
|
| 510 |
|
| 511 |
### Point Clouds
|
|
@@ -514,6 +384,136 @@ Each scene should include `points.ply`.
|
|
| 514 |
|
| 515 |
The initial point cloud was obtained by back-projecting the pixels from each camera view in the first frame based on depth, followed by randomly sampling 100,000 points from the resulting data.
|
| 516 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 517 |
<a id="license"></a>
|
| 518 |
|
| 519 |
## 📜 License
|
|
|
|
| 148 |
<strong>🧭 Navigation</strong><br><br>
|
| 149 |
<a href="#summary">📌 Summary</a><br>
|
| 150 |
<a href="#release-timetable">🚀 Release Timetable</a><br>
|
| 151 |
+
<a href="#how-to-download">📥 How to Download</a><br>
|
| 152 |
<a href="#dataset-structure">📦 Dataset Structure</a><br>
|
| 153 |
<a href="#data-splits">📊 Data Splits</a><br>
|
| 154 |
<a href="#data-fields">🧩 Data Fields</a><br>
|
|
|
|
| 215 |
|
| 216 |
For large-scale downloading and filtering, please refer to the **How to Use** section below.
|
| 217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
<a id="dataset-structure"></a>
|
| 219 |
|
| 220 |
## 📦 Dataset Structure
|
|
|
|
| 330 |
|
| 331 |
<a id="annotation-details"></a>
|
| 332 |
|
| 333 |
+
📝 Annotation Details
|
| 334 |
|
| 335 |
PhysInOne provides synchronized visual and physical annotations for each dynamic 3D scene.
|
| 336 |
|
|
|
|
| 345 |
Expected encoding:
|
| 346 |
|
| 347 |
| Pixel Value | Meaning |
|
| 348 |
+
| ----------- | -------------------------- |
|
| 349 |
| `0` | Background |
|
| 350 |
| `1-127` | Static foreground objects |
|
| 351 |
| `128-255` | Dynamic foreground objects |
|
|
|
|
| 362 |
|
| 363 |
Each scene includes multiple camera viewpoints to support 3D perception, reconstruction, and physics-based visual reasoning tasks.
|
| 364 |
|
| 365 |
+
- **Taichi-based MPM simulations** (elastic solids, plasticine, granular substances, some Newtonian and Non-Newtonian fluids): 15 static cameras + 1 dynamic camera
|
| 366 |
+
- **Other scenes**: 12 static cameras + 1 dynamic camera
|
| 367 |
|
| 368 |
**Camera JSON structure** (per camera):
|
| 369 |
|
| 370 |
+
- `frames`: list of per-frame 4×4 camera-to-world (C2W) transformation matrices in **Blender coordinate system**
|
| 371 |
+
- `camera_angle_x`: horizontal field of view (FOV) in radians, can be used to compute intrinsic focal length
|
| 372 |
+
- `img_w`, `img_h`: image width and height in pixels
|
| 373 |
+
- `trajectory_name`: name of the camera trajectory
|
| 374 |
- `total_frames`, `fps`: number of frames and frames per second
|
| 375 |
|
| 376 |
**Dynamic camera behavior**:
|
| 377 |
|
| 378 |
+
- The dynamic camera moves along a path randomly sampled on a hemisphere surrounding the center of the main objects, providing diverse viewpoints.
|
| 379 |
- JSON frame indices correspond directly to video frame indices.
|
| 380 |
|
| 381 |
### Point Clouds
|
|
|
|
| 384 |
|
| 385 |
The initial point cloud was obtained by back-projecting the pixels from each camera view in the first frame based on depth, followed by randomly sampling 100,000 points from the resulting data.
|
| 386 |
|
| 387 |
+
<a id="how-to-download"></a>
|
| 388 |
+
|
| 389 |
+
## 📥 How to Download
|
| 390 |
+
|
| 391 |
+
PhysInOne is distributed across multiple Hugging Face dataset repositories because of its large scale. We provide two scripts for selecting and downloading cases:
|
| 392 |
+
|
| 393 |
+
- `filter_cases.py`: parses the case-to-repository assignment file and exports selected cases to JSON.
|
| 394 |
+
- `download.py`: downloads the selected case zip files from the corresponding Hugging Face shard repositories.
|
| 395 |
+
|
| 396 |
+
The `filter_cases.py` script supports selection by:
|
| 397 |
+
|
| 398 |
+
- **Split**: `train`, `val`, `test`
|
| 399 |
+
- **Activity complexity**: `single`, `double`, `triple`
|
| 400 |
+
- **Physical phenomenon abbreviation**: `MovingHitsFixed`, `FrictionStop`, `LiquidTension`, ..., `GranularFall`
|
| 401 |
+
- **Number of cases**: globally sample `num` cases after filtering
|
| 402 |
+
|
| 403 |
+
## 1. Download Scripts
|
| 404 |
+
|
| 405 |
+
Please download the `assets` folder, which contains:
|
| 406 |
+
|
| 407 |
+
```text
|
| 408 |
+
metadata/
|
| 409 |
+
repo_assignment.txt
|
| 410 |
+
repo_map.json
|
| 411 |
+
scripts/
|
| 412 |
+
filter_cases.py
|
| 413 |
+
download.py
|
| 414 |
+
```
|
| 415 |
+
|
| 416 |
+
## 2. Install Dependencies
|
| 417 |
+
|
| 418 |
+
```bash
|
| 419 |
+
pip install huggingface_hub tqdm
|
| 420 |
+
```
|
| 421 |
+
|
| 422 |
+
## 3. Filter Cases
|
| 423 |
+
|
| 424 |
+
### 3.1 Filter by split
|
| 425 |
+
|
| 426 |
+
```bash
|
| 427 |
+
python scripts/filter_cases.py \
|
| 428 |
+
--split train \
|
| 429 |
+
--output selected_cases.json
|
| 430 |
+
```
|
| 431 |
+
|
| 432 |
+
### 3.2 Filter by split and activity complexity
|
| 433 |
+
|
| 434 |
+
```bash
|
| 435 |
+
python scripts/filter_cases.py \
|
| 436 |
+
--split train \
|
| 437 |
+
--activity_type double \
|
| 438 |
+
--output selected_cases.json
|
| 439 |
+
```
|
| 440 |
+
|
| 441 |
+
### 3.3 Filter by physical phenomenon abbreviation
|
| 442 |
+
|
| 443 |
+
By default, phenomenon matching uses `contains` mode. For example, the following command selects all double-physics cases that contain `FrictionStop`:
|
| 444 |
+
|
| 445 |
+
```bash
|
| 446 |
+
python scripts/filter_cases.py \
|
| 447 |
+
--split train \
|
| 448 |
+
--activity_type double \
|
| 449 |
+
--phenomena FrictionStop \
|
| 450 |
+
--match_mode contains \
|
| 451 |
+
--output selected_cases.json
|
| 452 |
+
```
|
| 453 |
+
|
| 454 |
+
For exact matching, use `--match_mode exact`. Order does not matter. For example, this command selects cases whose phenomenon set is exactly `{AccelConcaveSpin, AccelSurfaceSpin}`:
|
| 455 |
+
|
| 456 |
+
```bash
|
| 457 |
+
python scripts/filter_cases.py \
|
| 458 |
+
--split train \
|
| 459 |
+
--activity_type double \
|
| 460 |
+
--phenomena AccelConcaveSpin AccelSurfaceSpin \
|
| 461 |
+
--match_mode exact \
|
| 462 |
+
--output selected_cases.json
|
| 463 |
+
```
|
| 464 |
+
|
| 465 |
+
### 3.4 Randomly sample a fixed number of cases
|
| 466 |
+
|
| 467 |
+
`--num` is the global number of cases sampled after filtering. The default random seed is `42`.
|
| 468 |
+
|
| 469 |
+
```bash
|
| 470 |
+
python scripts/filter_cases.py \
|
| 471 |
+
--split train \
|
| 472 |
+
--activity_type double \
|
| 473 |
+
--phenomena FrictionStop \
|
| 474 |
+
--num 3000 \
|
| 475 |
+
--seed 42 \
|
| 476 |
+
--output selected_cases.json
|
| 477 |
+
```
|
| 478 |
+
|
| 479 |
+
## 4. Download Selected Cases
|
| 480 |
+
|
| 481 |
+
Each selected case is downloaded as a zip file from the corresponding Hugging Face shard repository.
|
| 482 |
+
|
| 483 |
+
```bash
|
| 484 |
+
python scripts/download.py \
|
| 485 |
+
--selection selected_cases.json \
|
| 486 |
+
--output_dir ./PhysInOne
|
| 487 |
+
```
|
| 488 |
+
|
| 489 |
+
If the dataset repositories are gated or private, pass a Hugging Face token:
|
| 490 |
+
|
| 491 |
+
```bash
|
| 492 |
+
python scripts/download.py \
|
| 493 |
+
--selection selected_cases.json \
|
| 494 |
+
--output_dir ./PhysInOne \
|
| 495 |
+
--token YOUR_HF_TOKEN
|
| 496 |
+
```
|
| 497 |
+
|
| 498 |
+
By default, downloaded zip files are saved into a flat output folder. To preserve shard/split/activity structure:
|
| 499 |
+
|
| 500 |
+
```bash
|
| 501 |
+
python scripts/download.py \
|
| 502 |
+
--selection selected_cases.json \
|
| 503 |
+
--output_dir ./PhysInOne \
|
| 504 |
+
--keep_shard_structure
|
| 505 |
+
```
|
| 506 |
+
|
| 507 |
+
The preserved structure is:
|
| 508 |
+
|
| 509 |
+
```text
|
| 510 |
+
PhysInOne/
|
| 511 |
+
physinone_part1/
|
| 512 |
+
Train/
|
| 513 |
+
DoublePhysics/
|
| 514 |
+
AccelConcaveSpin_AccelSurfaceSpin__bg070__K5ER39_trajectory.zip
|
| 515 |
+
```
|
| 516 |
+
|
| 517 |
<a id="license"></a>
|
| 518 |
|
| 519 |
## 📜 License
|