ruihong04 commited on
Commit
97ab756
·
verified ·
1 Parent(s): e04a49e

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. README.md +68 -0
  2. real/abc_130k_06_dual_robot_grippers/depth.h5 +3 -0
  3. real/abc_130k_06_dual_robot_grippers/moge.npz +3 -0
  4. real/abc_130k_06_dual_robot_grippers/tracks.npz +3 -0
  5. real/internet_07_spreading_viscous_chocolate/depth.h5 +3 -0
  6. real/internet_07_spreading_viscous_chocolate/moge.npz +3 -0
  7. real/internet_07_spreading_viscous_chocolate/tracks.npz +3 -0
  8. real/internet_30_rigid_kitchen_utensils/depth.h5 +3 -0
  9. real/internet_30_rigid_kitchen_utensils/flow.h5 +3 -0
  10. real/internet_30_rigid_kitchen_utensils/moge.npz +3 -0
  11. real/internet_30_rigid_kitchen_utensils/tracks.npz +3 -0
  12. real/internet_31_liquid_egg_yolk/depth.h5 +3 -0
  13. real/internet_31_liquid_egg_yolk/moge.npz +3 -0
  14. real/internet_31_liquid_egg_yolk/tracks.npz +3 -0
  15. real/internet_33_bridge_traffic_flowing/depth.h5 +3 -0
  16. real/internet_33_bridge_traffic_flowing/moge.npz +3 -0
  17. real/internet_33_bridge_traffic_flowing/tracks.npz +3 -0
  18. real/internet_37_putt_rolling_in/depth.h5 +3 -0
  19. real/internet_37_putt_rolling_in/flow.h5 +3 -0
  20. real/internet_37_putt_rolling_in/moge.npz +3 -0
  21. real/internet_37_putt_rolling_in/tracks.npz +3 -0
  22. real/physics_iq_benchmark_02_domino_effect_row/flow.h5 +3 -0
  23. real/physics_iq_benchmark_05_continuous_stream_viscous/depth.h5 +3 -0
  24. real/physics_iq_benchmark_05_continuous_stream_viscous/flow.h5 +3 -0
  25. real/physics_iq_benchmark_05_continuous_stream_viscous/moge.npz +3 -0
  26. real/physics_iq_benchmark_05_continuous_stream_viscous/tracks.npz +3 -0
  27. real/physics_iq_benchmark_07_ball_rolls_down/depth.h5 +3 -0
  28. real/physics_iq_benchmark_07_ball_rolls_down/flow.h5 +3 -0
  29. real/physics_iq_benchmark_07_ball_rolls_down/moge.npz +3 -0
  30. real/physics_iq_benchmark_07_ball_rolls_down/tracks.npz +3 -0
  31. real/wisa_80k_07_rocking_tank_wave/depth.h5 +3 -0
  32. real/wisa_80k_07_rocking_tank_wave/flow.h5 +3 -0
  33. real/wisa_80k_07_rocking_tank_wave/moge.npz +3 -0
  34. real/wisa_80k_07_rocking_tank_wave/tracks.npz +3 -0
  35. real/wisa_80k_32_hydraulic_press_squashing/depth.h5 +3 -0
  36. real/wisa_80k_32_hydraulic_press_squashing/moge.npz +3 -0
  37. real/wisa_80k_32_hydraulic_press_squashing/tracks.npz +3 -0
  38. real/wisa_80k_33_domino_line_triggering/depth.h5 +3 -0
  39. real/wisa_80k_33_domino_line_triggering/flow.h5 +3 -0
  40. real/wisa_80k_33_domino_line_triggering/moge.npz +3 -0
  41. real/wisa_80k_33_domino_line_triggering/tracks.npz +3 -0
  42. real/wisa_80k_46_wooden_pestle_crushing/depth.h5 +3 -0
  43. real/wisa_80k_46_wooden_pestle_crushing/flow.h5 +3 -0
  44. real/wisa_80k_46_wooden_pestle_crushing/moge.npz +3 -0
  45. real/wisa_80k_46_wooden_pestle_crushing/tracks.npz +3 -0
  46. real/wisa_80k_48_bullet_shattering_glass/depth.h5 +3 -0
  47. real/wisa_80k_48_bullet_shattering_glass/flow.h5 +3 -0
  48. real/wisa_80k_48_bullet_shattering_glass/moge.npz +3 -0
  49. real/wisa_80k_48_bullet_shattering_glass/tracks.npz +3 -0
  50. scripts/extract_synthetic.py +106 -0
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task_categories:
3
+ - other
4
+ ---
5
+
6
+ # 4DCodeBench-ModelEstimation
7
+
8
+ [Project page](https://4dcodebench.com) | [Paper](https://huggingface.co/papers/2610.03715) | [Code](https://github.com/4DCodeBench/4DCodeBench)
9
+
10
+ The depth, optical flow and point tracks that [4DCodeBench](https://4dcodebench.com) scores reconstructions against, so the benchmark can be evaluated without installing the models behind them. On the 100 real-world cases they are estimated from the reference video by off-the-shelf models and released here as files. On the 100 synthetic cases they are ground truth, computed from the reference world by the script in `scripts/`.
11
+
12
+ ## Layout
13
+
14
+ ```text
15
+ real/<case>/depth.h5 Video Depth Anything disparity
16
+ real/<case>/flow.h5 RAFT optical flow
17
+ real/<case>/tracks.npz CoTracker3 point tracks
18
+ real/<case>/moge.npz MoGe-3 point map of frame 0
19
+ scripts/extract_synthetic.py
20
+ ```
21
+
22
+ 53 GB: 46.1 GB of flow, 5.6 GB of depth, 0.9 GB of point maps and 0.2 GB of tracks. `<case>` is the case name of [Dataset-Real-World](https://huggingface.co/datasets/4DCodeBench/Dataset-Real-World).
23
+
24
+ ## Real-world cases
25
+
26
+ Each file was computed once from the case's `reference.mp4` and is what every score in the paper was read against. `F`, `H` and `W` are the video's frame count, height and width; every real video has at most 300 frames, so all of them are read frame by frame (`stride` is 1).
27
+
28
+ | file | model | contents |
29
+ |---|---|---|
30
+ | `depth.h5` | [Video Depth Anything](https://huggingface.co/depth-anything/Video-Depth-Anything-Large), Large, FP32 | `disparity (F, h, w)` float16, relative (affine-invariant), on the model's own output grid (short side 518 px on 98 of the 100 cases), to be resized to `(H, W)`; `shape [F, H, W]`, `fps`, `stride` |
31
+ | `flow.h5` | [RAFT](https://pytorch.org/vision/stable/models/raft.html), torchvision `Raft_Large_Weights.C_T_SKHT_V2`, 12 iterations | `flow (F-1, H, W, 2)` float16, `(u, v)` pixels from frame `t` to `t + 1`; `valid (F-1, H, W)` bool, all true; `stride`, `model`, `iterations` |
32
+ | `tracks.npz` | [CoTracker3](https://huggingface.co/facebook/cotracker3), offline | `tracks (Q, F, 2)` float32 pixels, `visible (Q, F)` bool, `queries (Q, 3)` `(0, x, y)` on frame 0, `on_mask (Q,)` bool, `shape [F, H, W]`, `step`, `stride`, `model`, `tracking_resolution` |
33
+ | `moge.npz` | [MoGe-3](https://huggingface.co/Ruicheng/moge-3-vitl), ViT-L, resolution level 9, 3 refinement steps | `points (H, W, 3)` float32 in camera space up to the model's scale, `mask (H, W)` bool, `intrinsics (3, 3)` normalised to the unit image, `shape [H, W]`, `model` |
34
+
35
+ The `.h5` files are HDF5 with LZF compression, one frame per chunk. Flow, tracks and points are in full-resolution pixels of the video.
36
+
37
+ The track queries are the benchmark's grid of at most 2048 points on frame 0: 512 spread over the whole frame, which Track2D uses to remove camera motion, and the rest laid densely inside the case's annotated dynamic mask, marked by `on_mask`. CoTracker3 tracks the video at a long side of 768 px (`tracking_resolution`) and the tracks are scaled back to full resolution.
38
+
39
+ 23 real videos cannot be redistributed and are rebuilt by Dataset-Real-World's `prepare_videos.py`, whose output can slightly differ from the benchmark's copy by H.264 encoder noise. The estimates here are of the benchmark's copy.
40
+
41
+ ## Synthetic cases
42
+
43
+ A synthetic case has the world it was rendered from, so its depth, flow and tracks are computed exactly rather than estimated. `scripts/extract_synthetic.py` writes them in the same layout as the real cases, from the meshes, material trajectories and camera of each world, with the same code the scorer uses to read a submission. No model checkpoint is needed.
44
+
45
+ With the [code release](https://github.com/4DCodeBench/4DCodeBench) set up and the synthetic worlds downloaded by its `scripts/download_data.py --kind synthetic`, run from the code release's root:
46
+
47
+ ```bash
48
+ python /path/to/scripts/extract_synthetic.py # all 100 cases into ./synthetic/<case>/
49
+ python /path/to/scripts/extract_synthetic.py B_01 --out gt
50
+ ```
51
+
52
+ It needs a CUDA GPU for nvdiffrast; a case of 100–150 frames takes about 15 s and the longest, 600 frames, under a minute.
53
+
54
+ | file | contents |
55
+ |---|---|
56
+ | `depth.h5` | `depth (F', H, W)` float32 camera-space z in metres, `inf` where no surface covers the pixel; `shape [F, H, W]`, `fps`, `stride` |
57
+ | `flow.h5` | `flow (F'-1, H, W, 2)` float16 pixels from sampled frame `k` to `k + 1`, `valid (F'-1, H, W)` bool, `stride` |
58
+ | `tracks.npz` | the keys of the real cases but `tracking_resolution`, with the dense queries on the world's own frame-0 dynamic pixels and `model` `ground_truth` |
59
+
60
+ The 8 synthetic videos longer than 300 frames are read on a thinned timeline: frames `0, s, 2s, …` with the smallest stride `s` that keeps at most 300 of them, so `F' = ceil(F / s)`. `stride` in each file records `s`.
61
+
62
+ ## Using them with the benchmark
63
+
64
+ The code release reads these files from `data/real/<case>/estimates/` under the same names, so copying `real/<case>/*` there lets `python -m scorer` read Flow, Track2D, Depth error and Uni3D MoGe without the estimation models. Its other reference features (DINOv3, TIPS) still come from `python -m scorer.prepare --only semantic,geophys`, whose models are on the Hugging Face Hub.
65
+
66
+ ## Licences
67
+
68
+ The real-world files are outputs of models with their own licences: Video Depth Anything Large and CoTracker3 are CC BY-NC 4.0, RAFT (torchvision) is BSD-3-Clause, and MoGe-3 is MIT. The videos they were computed from are under the terms listed in Dataset-Real-World.
real/abc_130k_06_dual_robot_grippers/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc728958d9e279f1657df6b4f702cccc850a7e42911a20b2bb0bebd5f67d4d14
3
+ size 58252786
real/abc_130k_06_dual_robot_grippers/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dbfa8a222166d36701a7466ca0d1b37d2b89629b1b03f4f539015c6cc4566706
3
+ size 3235381
real/abc_130k_06_dual_robot_grippers/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97307d8a08820cd3e036c01537464e5c2cab663649af7c38383bd6af54124550
3
+ size 2667211
real/internet_07_spreading_viscous_chocolate/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e215e5c76603aa306354533734c16e496445044559eb79be98ad66178791434
3
+ size 89638692
real/internet_07_spreading_viscous_chocolate/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4394ae161938707012bcd87d6864ff1fa4b342295bc235eac4dba850489e9c00
3
+ size 6657790
real/internet_07_spreading_viscous_chocolate/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2e86d0442aca8e0d7511e27407bc65984c2bafb25c89581f1b9ecfc69e79570
3
+ size 3769881
real/internet_30_rigid_kitchen_utensils/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c1b91331c37b0a0dc4472806be7f77a386920a6285b73c889266eab6afab946
3
+ size 29895910
real/internet_30_rigid_kitchen_utensils/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aca478333898d93d65fdcfe96df9d9258a055167484d8df8bb417be10d7f5850
3
+ size 287602717
real/internet_30_rigid_kitchen_utensils/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:153b0a0006202c0098096b3e3242034653a930ac9cb4974c32152a69b5cba2af
3
+ size 11546673
real/internet_30_rigid_kitchen_utensils/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22d5aa38605c05fbdc0e94f186840a87d22cc3c91ebab7e785a34ffb1a0fb6e1
3
+ size 1340982
real/internet_31_liquid_egg_yolk/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:700598c0e976f03d09101204eeb71e949e6ce06e6371e4513374da452d72c122
3
+ size 18449429
real/internet_31_liquid_egg_yolk/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e6cff9896ac1d94149d8905fa34363c6fd80b5c2e61219ccc2fad34f7a44fb8
3
+ size 15052356
real/internet_31_liquid_egg_yolk/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad1d8d9e79e496af10341eb14b34f45896aa0a8a3bf69c08a13876a2ba3be0a2
3
+ size 1017687
real/internet_33_bridge_traffic_flowing/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50e0c04effc02c04536019fa694c3b3d6fe6a97b2a8202996dc7c06f109cfd59
3
+ size 78627895
real/internet_33_bridge_traffic_flowing/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e00fc4ea68817d5ccafc704f2a5cf10dd1f3bd7907479f720f4cf40ae800e62d
3
+ size 12430503
real/internet_33_bridge_traffic_flowing/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2b0123073b7b841c0b469777a172f488e72adc2eb7cd49fbdc12c65f8e43b98
3
+ size 3675322
real/internet_37_putt_rolling_in/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47afc2a62e79a912874b0fe631a13397dfc6ad85e4e75a16df944d926f8a0060
3
+ size 39792027
real/internet_37_putt_rolling_in/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ccf6485d379f9696173e755571d3cc52925c9a71f201356d8e460b88ad98558
3
+ size 425135238
real/internet_37_putt_rolling_in/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2a2e1037e8fd73eee6b49f7716ca3b7899dae6c4fff97e3b62ca64be9f8b536
3
+ size 9025766
real/internet_37_putt_rolling_in/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5d5185f2327f11c32ad4362fb1689a52a8c14c215264e4465dbda88e24aab43
3
+ size 1802691
real/physics_iq_benchmark_02_domino_effect_row/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6776e2f67264ff3f2b47c76e936c17d5d40684a241d0a5565f2770822e974686
3
+ size 654860093
real/physics_iq_benchmark_05_continuous_stream_viscous/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7dee8da5f56bb12c06a9028a664bb062bf800c9a2a5d85922ccf02fadc0a4ef0
3
+ size 74982791
real/physics_iq_benchmark_05_continuous_stream_viscous/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0b11226354ef0eec93927170e39b3bc546fb3eee90ae595e1bba33534f6573a
3
+ size 651006199
real/physics_iq_benchmark_05_continuous_stream_viscous/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a8ef12e2273e02985ca9bfaa218f909c8eeb9c7f77b1c505c0aa547c4ebeea4
3
+ size 9479228
real/physics_iq_benchmark_05_continuous_stream_viscous/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d768780c7a58729c5068745eaf90612cf83b77ef2dcf0cc6a49808de1ad9da59
3
+ size 2209762
real/physics_iq_benchmark_07_ball_rolls_down/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b418e603fa911a7cacf27c88a6cc157401ec3e1cb2b1a2d3d75bd40d6cc40c0
3
+ size 68567205
real/physics_iq_benchmark_07_ball_rolls_down/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a1bc177e552a792324e7d32f92722bea7fd595b3d76d72700055fe0fe3ea9e6
3
+ size 626095690
real/physics_iq_benchmark_07_ball_rolls_down/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d414f67fa0754a41b0aa0820c59a0e12534efdeb39b53d15b7f178a5ba3f2c8
3
+ size 9423143
real/physics_iq_benchmark_07_ball_rolls_down/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8617eec4a3ccbccc9e9ac35a6c926fd264d0f8692eb84ab9566a0b8427035311
3
+ size 2823044
real/wisa_80k_07_rocking_tank_wave/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acdac57f65f0bbac67c6df55d30cc901f233c026474fe9d76531d4631905f83b
3
+ size 63132029
real/wisa_80k_07_rocking_tank_wave/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:802e9bb57302e4bbcb84fb86886623771a7296851785f080b8afe52b8dda0cba
3
+ size 657138712
real/wisa_80k_07_rocking_tank_wave/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08035fa501b2434d24ecdd0b1118e2937d7edf75356f92548859a0113c4aeee3
3
+ size 9613899
real/wisa_80k_07_rocking_tank_wave/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fbce05d45a0e934abe6972e9bb806ce567639be4c446d0f368d4bdbf26517ae6
3
+ size 3088825
real/wisa_80k_32_hydraulic_press_squashing/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c7fbb18c0cd63860474abe76afa98abc558c3bbb6a0996df28466a46a08f439
3
+ size 49977979
real/wisa_80k_32_hydraulic_press_squashing/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78013602a08db3e697ed1945d15b36acda7e1925858cc065bd28f513281df36a
3
+ size 9051110
real/wisa_80k_32_hydraulic_press_squashing/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7364c00c4c88e299d1606a71a1b37cdc72a0527fb7ac4427e506a13b7b8df18c
3
+ size 2171701
real/wisa_80k_33_domino_line_triggering/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67b813e166a37922596aef5de235482db0f61d21c5159ae8ed694f842fde47dc
3
+ size 86532133
real/wisa_80k_33_domino_line_triggering/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b128c7796365cdf45ca36626b41f4eb71e7484b43e13715132716078109d7bc3
3
+ size 792238781
real/wisa_80k_33_domino_line_triggering/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4a6ad434bfd09350028807c1cac5b0abc34713086ee89188e48928fe4ef85ee
3
+ size 9366007
real/wisa_80k_33_domino_line_triggering/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1e5990718293e89f0532d25dca6ad028ff7453a5d34312e8f222317d00876d3
3
+ size 3030465
real/wisa_80k_46_wooden_pestle_crushing/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a7c49af9e6ff835398ff87ae4046e94a6291a7a93d8c61cfa867edba7b43a8c
3
+ size 42009438
real/wisa_80k_46_wooden_pestle_crushing/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1e06be29dafde6cd52bd53d630c058f671e5edfdbd8cdf7a5ef8ed3af9d7cbf
3
+ size 354997602
real/wisa_80k_46_wooden_pestle_crushing/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7f3097acf008b3435e62c8f7b895a5da878cffe78c49d8109699d5dea902133
3
+ size 4761583
real/wisa_80k_46_wooden_pestle_crushing/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63e7d224771d69dbffe94eec9ef2a5b84a01f4fa77d69b5827a79998b4e7817f
3
+ size 1789165
real/wisa_80k_48_bullet_shattering_glass/depth.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38558897842c0813b0786fc76f92605b234fb52d502b60bea3905fa06b05c47e
3
+ size 107745708
real/wisa_80k_48_bullet_shattering_glass/flow.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:727bedda1cdb5a28c90a4ae87bafdc9de39f3e4b2670ee110c72dbb46ab87e35
3
+ size 680733504
real/wisa_80k_48_bullet_shattering_glass/moge.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed967a02cbd85a682d90d1e04b8e4ec57d2931324a7d339f61389015a32b0f18
3
+ size 8884039
real/wisa_80k_48_bullet_shattering_glass/tracks.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45f3cebff37684e885f1ca0675aaa75a0ef8b196bb9acdf0e8c239ccf2bdf45c
3
+ size 2849569
scripts/extract_synthetic.py ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Ground-truth depth, flow and tracks of the synthetic cases, from their reference worlds.
3
+
4
+ Run from the root of the 4DCodeBench code release, after its environment is set up
5
+ and `python scripts/download_data.py --kind synthetic` has unpacked the worlds:
6
+
7
+ python /path/to/extract_synthetic.py # every case under data/synthetic
8
+ python /path/to/extract_synthetic.py B_01 G_03 --out gt # some cases, another output root
9
+
10
+ Each case gets `<out>/<case>/` with the same files, keys and timeline as the real
11
+ cases' estimates, computed from the world's meshes and camera instead of a model:
12
+
13
+ depth.h5 `depth (F', H, W)` float32 camera-space z in metres, `inf` where no
14
+ surface covers the pixel; `shape [F, H, W]`, `stride`, `fps`
15
+ flow.h5 `flow (F'-1, H, W, 2)` float16 pixels from sampled frame k to k + 1,
16
+ `valid (F'-1, H, W)` bool, `stride`
17
+ tracks.npz `tracks (Q, F', 2)` float32 pixels, `visible (Q, F')` bool, the frame-0
18
+ queries `queries (Q, 3)` `(0, x, y)`, `on_mask`, `shape`, `step`, `stride`
19
+
20
+ Flow and tracks follow each surface point through the world: by its face and
21
+ barycentrics where the object keeps its topology, by the nearest material columns of
22
+ `dynamics/` where it does not (a liquid, a fracture). These are the scorer's own
23
+ `scorer.analytic` paths, the ones it reads every submission with. The query grid is
24
+ the benchmark's: dense on the frame-0 dynamic pixels, sparse over the whole frame.
25
+ Files already written are skipped, so an interrupted run resumes by running again.
26
+ """
27
+
28
+ from __future__ import annotations
29
+
30
+ import argparse
31
+ import sys
32
+ import time
33
+ from pathlib import Path
34
+
35
+ import numpy as np
36
+
37
+
38
+ def main() -> None:
39
+ ap = argparse.ArgumentParser(description=__doc__,
40
+ formatter_class=argparse.RawDescriptionHelpFormatter)
41
+ ap.add_argument("cases", nargs="*", help="case names (default: every world under --data)")
42
+ ap.add_argument("--code", type=Path, default=Path("."), help="code release root (default: .)")
43
+ ap.add_argument("--data", type=Path, default=None,
44
+ help="directory of <case>/world (default: <code>/data/synthetic)")
45
+ ap.add_argument("--out", type=Path, default=Path("synthetic"), help="output root")
46
+ args = ap.parse_args()
47
+
48
+ sys.path.insert(0, str(args.code.resolve()))
49
+ from config.estimates import DEPTH_FILENAME, FLOW_FILENAME, TRACKS_FILENAME
50
+ from config.sampling import sampled_indices, stride_for
51
+ from scorer.analytic.flow import frame_flow
52
+ from scorer.analytic.tracks import DRIFT, grid_queries, grid_step, inside, track_points
53
+ from scorer.raster import default_device, id_frame, rasterize_frame
54
+ from scorer.storage import write_dense
55
+ from scorer.world import World
56
+
57
+ data = args.data or args.code / "data/synthetic"
58
+ cases = args.cases or sorted(p.parent.name for p in data.glob("*/world"))
59
+ device = default_device()
60
+
61
+ for number, case in enumerate(cases, 1):
62
+ out = args.out / case
63
+ out.mkdir(parents=True, exist_ok=True)
64
+ world = World(data / case / "world")
65
+ stride = stride_for(world.frames)
66
+ frames = sampled_indices(world.frames, stride)
67
+ height, width = world.shape[1:]
68
+ started = time.time()
69
+
70
+ if not (out / DEPTH_FILENAME).exists():
71
+ depth = np.stack([rasterize_frame(world, int(t), device)[0] for t in frames])
72
+ write_dense(out / DEPTH_FILENAME, depth=depth.astype(np.float32),
73
+ shape=np.asarray(world.shape, dtype=np.int64),
74
+ stride=np.int64(stride), fps=np.float64(world.fps))
75
+
76
+ if not (out / FLOW_FILENAME).exists():
77
+ flows, valids = [], []
78
+ for t in frames[:-1]:
79
+ flow, valid, _ = frame_flow(world, int(t), device, stride=stride)
80
+ flows.append(flow.cpu().numpy().astype(np.float16))
81
+ valids.append(valid.cpu().numpy())
82
+ write_dense(out / FLOW_FILENAME, flow=np.stack(flows), valid=np.stack(valids),
83
+ stride=np.int64(stride), model="ground_truth")
84
+
85
+ if not (out / TRACKS_FILENAME).exists():
86
+ mask = np.isin(id_frame(world, 0, device), world.dynamic_ids)
87
+ mask = mask if mask.any() else None
88
+ queries = grid_queries(height, width, mask=mask)
89
+ on_mask = (inside(queries[:, 1:], mask) if mask is not None
90
+ else np.zeros(len(queries), dtype=bool))
91
+ step = (grid_step(height, width, max(len(queries) - DRIFT, 1), mask)
92
+ if mask is not None else grid_step(height, width))
93
+ tracks, visible = track_points(world, queries, device, stride=stride)
94
+ np.savez_compressed(out / TRACKS_FILENAME, tracks=tracks.astype(np.float32),
95
+ visible=visible, queries=queries.astype(np.float32),
96
+ on_mask=on_mask,
97
+ shape=np.asarray([len(frames), height, width], dtype=np.int64),
98
+ step=np.int64(step), stride=np.int64(stride),
99
+ model="ground_truth")
100
+
101
+ print(f"[{number}/{len(cases)}] {case}: {len(frames)} frames, "
102
+ f"{time.time() - started:.0f}s", flush=True)
103
+
104
+
105
+ if __name__ == "__main__":
106
+ main()