zhuxh-nvidia commited on
Commit
b11ef79
·
verified ·
1 Parent(s): d47a178

Add track_3 README

Browse files
Files changed (1) hide show
  1. track_3/README.md +159 -0
track_3/README.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Track 3
2
+
3
+ Human manipulation of everyday objects, captured with a Vicon motion-capture system and
4
+ two OAK camera rigs. Every tracked object has a textured 3D scan, and object poses are
5
+ expressed **in that scan's own frame**, so placing a mesh at a logged pose puts it where
6
+ the real object was.
7
+
8
+ | | |
9
+ |---|---|
10
+ | Episodes | 46 |
11
+ | Frames | 12,077 (127–421 per episode, mean 263) |
12
+ | Rate | 20.25 fps nominal |
13
+ | Tasks | 16 |
14
+ | Cameras | 6 streams, 276 clips |
15
+ | Objects | 11, each with a textured mesh |
16
+
17
+ ## Layout
18
+
19
+ ```
20
+ track_3/
21
+ ├── data/chunk-000/episode_0000NN.parquet poses + timing, one row per frame
22
+ ├── videos/chunk-000/observation.images.<camera>/episode_0000NN.mp4
23
+ ├── mesh/<object>/<object>.glb textured scan, metres, origin-centred
24
+ └── meta/
25
+ ├── info.json schema, counts, tasks, objects
26
+ ├── episodes_metadata.jsonl episode → task, capture notes
27
+ └── camera_calibration.json intrinsics, distortion, stereo
28
+
29
+ ```
30
+
31
+ ## Pose data
32
+
33
+ Each parquet has **7 columns**, one row per video frame:
34
+
35
+ ```
36
+ observation.objects list<struct{name: string,
37
+ pose: fixed_size_list<float32, 7>,
38
+ visible: bool}>
39
+ timestamp capture_time frame_index episode_index index task_index
40
+ ```
41
+
42
+ `observation.objects` holds only the objects that episode tracks (1–2, occasionally more).
43
+ **Membership is constant within an episode** and sorted by name, so `objects[i]` is the
44
+ same object on every frame and no per-frame branching is needed. The episode's object list
45
+ is also in the parquet's schema metadata under `objects`.
46
+
47
+ An object's `name` **is** its mesh folder: `white_pot` → `mesh/white_pot/white_pot.glb`.
48
+
49
+ ### Conventions
50
+
51
+ - **`pose` is `[x, y, z, qw, qx, qy, qz]`** — translation in metres, **quaternion w-first**.
52
+ - **Poses are `world_T_object`**, the frame of the scanned mesh, not the mocap rigid body.
53
+ Each parquet declares this in schema metadata under `pose_convention`.
54
+ - **x and y are centred per episode** on the mean of that episode's visible object
55
+ positions. **z is not centred**, so height above the table stays physical (~0.61 m
56
+ resting). The offset is baked into the values and is not stored, so episodes do not
57
+ share a common origin.
58
+ - When `visible` is false the pose is all zeros — a zero quaternion, not a rotation.
59
+ **Filter on `visible` before using a pose.**
60
+
61
+ ## Cameras
62
+
63
+ | Stream | Resolution | Kind |
64
+ |---|---|---|
65
+ | `exo_cam_a` | 2028×1520 | colour, static third-person |
66
+ | `exo_cam_b`, `exo_cam_c` | 1280×800 | mono stereo pair, 75 mm baseline |
67
+ | `ego_cam_a` | 2028×1520 | colour, head-mounted |
68
+ | `ego_cam_b`, `ego_cam_c` | 1280×800 | mono stereo pair, 75 mm baseline |
69
+
70
+ Video is **frame-exact with the parquets** — row *i* corresponds to frame *i* in every
71
+ clip, verified across all 276.
72
+
73
+ `meta/camera_calibration.json` has intrinsics, distortion, and intra-rig stereo extrinsics.
74
+ It has **no camera-to-mocap-world extrinsic**, so meshes cannot be projected into the
75
+ images without solving that first. The exo camera is static across the whole session, so
76
+ one pose would serve all episodes; the ego camera moves per frame.
77
+
78
+ The two rigs are not hardware-synchronised: mean cross-device skew is 7.39 ms (~0.15 frame).
79
+
80
+ ## Quickstart
81
+
82
+ ```bash
83
+ pip install numpy scipy pyarrow trimesh viser # ffmpeg must be on PATH
84
+ python visualize_dataset.py # opens http://localhost:8080
85
+ ```
86
+
87
+ The viewer plays an episode with the real meshes at their poses, shows all six camera
88
+ streams as one synchronised mosaic, and reports the dataset and episode metadata.
89
+
90
+ ### Reading poses
91
+
92
+ ```python
93
+ import json
94
+ import numpy as np
95
+ import pyarrow.parquet as pq
96
+
97
+ table = pq.read_table("data/chunk-000/episode_000000.parquet")
98
+ rows = table["observation.objects"].to_pylist()
99
+
100
+ names = [entry["name"] for entry in rows[0]] # constant for the episode
101
+ for i, name in enumerate(names):
102
+ pose = np.array([row[i]["pose"] for row in rows]) # (frames, 7)
103
+ visible = np.array([row[i]["visible"] for row in rows])
104
+ xyz, wxyz = pose[visible, :3], pose[visible, 3:]
105
+ print(name, xyz.shape, "z range", xyz[:, 2].min().round(3), xyz[:, 2].max().round(3))
106
+
107
+ print(table.schema.metadata[b"pose_convention"].decode()) # world_T_object
108
+ ```
109
+
110
+ ### Placing a mesh at a pose
111
+
112
+ ```python
113
+ import trimesh
114
+ from scipy.spatial.transform import Rotation
115
+
116
+ mesh = trimesh.load("mesh/white_pot/white_pot.glb", process=False).to_geometry()
117
+ x, y, z, qw, qx, qy, qz = pose[100]
118
+
119
+ transform = np.eye(4)
120
+ transform[:3, :3] = Rotation.from_quat([qx, qy, qz, qw]).as_matrix() # scipy is xyzw
121
+ transform[:3, 3] = [x, y, z]
122
+ mesh.apply_transform(transform) # now in world coordinates
123
+ ```
124
+
125
+ ### Reading a video frame
126
+
127
+ ```python
128
+ import subprocess
129
+
130
+ def frame(path, index, width=640, height=480):
131
+ raw = subprocess.run(
132
+ ["ffmpeg", "-v", "error", "-i", path,
133
+ "-vf", f"select=eq(n\\,{index}),scale={width}:{height}",
134
+ "-vframes", "1", "-f", "rawvideo", "-pix_fmt", "rgb24", "-"],
135
+ capture_output=True, check=True).stdout
136
+ return np.frombuffer(raw, np.uint8).reshape(height, width, 3)
137
+
138
+ img = frame("videos/chunk-000/observation.images.exo_cam_a/episode_000000.mp4", 100)
139
+ ```
140
+
141
+ ## Known characteristics
142
+
143
+ Things that are true of the data and will surprise you if you assume otherwise.
144
+
145
+ - **`timestamp` is a synthetic uniform grid** (49.373 ms ± 0.0002), while `capture_time`
146
+ is the real clock (50.005 ms ± 1.756, range 12–95 ms). They diverge by up to 265 ms
147
+ within an episode. **Use `capture_time` for velocities**; `timestamp` implies 20.254 fps
148
+ where the true rate is 19.998.
149
+ - **26 single-frame position spikes** (0.215% of frames) across 8 episodes, most in
150
+ episode 7. Each is an isolated jump of 40–125 mm with near-stationary neighbours — a
151
+ mocap glitch, not motion. A median filter over 3 frames removes them.
152
+ - **`plastic_dish_rack` never moves.** It is a fixture in all 12 of its episodes: total
153
+ path ≤65 mm, bounding box ≤5 mm. `blue_cup` is likewise static in episode 11
154
+ (`Cup_Stack`), where it is the base of the stack.
155
+ - **`notes` keeps the original capture numbering**, so it has gaps where episodes were
156
+ removed (`Pan_In_Dishrack` runs `Ep_1, Ep_6, Ep_7`). `episode_index` is contiguous;
157
+ `notes` is provenance.
158
+ - **`Pour_Cup_Into_Pot` uses a different cup in each of its two episodes** (`beige_cup`,
159
+ `blue_cup`). Every other task has a fixed object set.