yxma commited on
Commit
b267863
·
verified ·
1 Parent(s): 1c4cf67

README: document the estimated contact-force columns (force_*_normal_n / penetration_mm / target_pose), the 1 N/mm stiffness assumption, and the limits — the data shipped without a word about it

Browse files
Files changed (1) hide show
  1. README.md +224 -46
README.md CHANGED
@@ -43,7 +43,7 @@ Dense, contact-rich, synchronized multimodal interaction data collected from **h
43
 
44
  ## Format — LeRobot-style video release
45
 
46
- Each episode ships as **5 MP4 video streams** (640×480, H.264) + a **per-frame parquet** of poses and contact metrics. This matches how LeRobot / DROID / Open X-Embodiment ship manipulation data: tiny on disk (whole dataset ≈ 4.3 GB vs ~1 TB raw), random-access decodable, training-ready.
47
 
48
  ```
49
  data/<task>/
@@ -92,54 +92,107 @@ then mapped to newtons by a calibration fitted on sphere presses of known load.
92
  | `force_{left,right}_target_pose` | list[7] | that sensor's pose displaced `F/k` along the contact normal (quaternion carried through unchanged) |
93
 
94
  ```python
95
- import pyarrow.parquet as pq
96
  t = pq.read_table("data/motherboard/meta/2026-05-10/episode_000.parquet")
97
- f = t["force_left_normal_n"].to_numpy() # N, per frame
98
- tgt = np.array(t["force_left_target_pose"].to_pylist()) # (T, 7)
 
99
  ```
100
 
101
- **`target_pose` is the force-informed action.** Training on the observed pose
102
- teaches "go here"; training on the target teaches "go here *and push this
103
- hard*", which an impedance controller reproduces at deployment. In free space
104
- the two are byte-identical (`F = 0 target == observed`, verified
105
- element-wise on 301,727 rows), so nothing changes where nothing is touched.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
  #### Read this before using the numbers
108
 
109
- - **`k = 1.0 N/mm` is a declared assumption, not a measurement.** It is written
110
- into the parquet field metadata (`twm.stiffness_n_per_mm`) and the
111
- `<episode>.force.json` sidecar so a target pose is never uninterpretable.
112
- To use a different stiffness, recompute from `force_*_normal_n` directly —
113
- `penetration = F / k`, `target = observed + (F/k)·n̂`.
114
- - **1 N/mm is on the soft side.** p95 penetration is 5.78 mm and 8.84% of rows
115
- exceed the 4.25 mm gel thickness. `k ≈ 1.4` keeps p95 inside the gel,
116
- `k ≈ 1.7` the maximum.
117
- - **Forces saturate at 7.285 N** — the calibration's isotonic stage clips at
118
- the hardest press it was fitted on, so 0.90% of samples sit exactly at that
119
- value. Treat the maximum as a floor, not a measurement.
120
  - **Accuracy is rank-order within a group, not a certified absolute scale.**
121
- Held out by press position the estimator scores ρ = 0.739 / MAE 1.23 N on
122
- its own calibration objects. On five public force-labelled datasets the same
123
  pipeline reaches ρ 0.775–0.986. It is reliable for *how hard, relative to
124
- other frames*; it is not a load cell.
 
 
 
 
 
125
  - **Duplicate tactile rows repeat the previous estimate.** The GelSight stream
126
  is slower than 30 Hz; rows with `tactile_{side}_is_new == False` carry the
127
  previous frame's force unchanged (forward fill, asserted exact). Filter on
128
- `is_new` if you need independent samples.
129
- - **Contact must be visible.** A contact clipped by the sensor border is
130
- systematically under-measured.
131
-
132
- Provenance travels with the data: `data/force_export_manifest.json` and
133
- `data/force_export_verify.json` record which calibration produced these
134
- newtons and every check it passed (row alignment 72/72, free-space identity,
135
- round-trip `k·‖target−observed‖ = F` closing to 5.6e-14 N).
136
-
137
- Method, validation against five public datasets, and the failure cases:
138
- **https://huggingface.co/spaces/yxma/react-force-recovery**
139
-
140
- The preview clips under `data/motherboard/previews/` show the force directly —
141
- a semi-transparent disc on each camera view, centred on that sensor's projected
142
- position, whose **area** is linear in newtons (legend in frame).
143
 
144
  ### depth (optional, `data/<task>/depth/`)
145
  Per-camera depth is shipped as **lossless FFV1 16-bit video** (`gray16le`):
@@ -169,16 +222,16 @@ Camera extrinsics are used only for the projection overlay; **stored poses are O
169
 
170
  ## Downloading — depth is optional
171
 
172
- The dataset splits into a **lightweight core** (RGB + tactile + poses, ~4.4 GB) and an **optional depth tree** (`data/<task>/depth/`, ~33 GB lossless). Depth lives in its own subtree so you can skip it entirely.
173
 
174
  ```python
175
  from huggingface_hub import snapshot_download
176
 
177
- # Core only — RGB + tactile + parquet, NO depth (~4.4 GB)
178
  snapshot_download("yxma/React", repo_type="dataset",
179
  ignore_patterns=["*/depth/*"])
180
 
181
- # Everything including depth (~37 GB)
182
  snapshot_download("yxma/React", repo_type="dataset")
183
 
184
  # One task only
@@ -265,15 +318,140 @@ source recordings: **0 mismatches over 899 frames on each of 7 audited
265
  episodes**, spanning both tasks. The same check independently recovers the
266
  +15-frame latency correction baked into the release.
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  ## Data quality
269
- Per-task `bad_frames.json` flags `intensity_spikes`, `pose_teleports_{L,R}`, `ot_loss_{L,R}` (OptiTrack track loss). Overall flagged: motherboard 0.90 %, pushT 0.67 %. `segments.json` already excludes them.
270
 
271
- **Runt episodes.** Two motherboard recordings are far too short to be complete demonstrations and are best filtered out: `2026-05-19/episode_003` (4.0 s) and `2026-05-19/episode_004` (7.0 s). Median episode length is 213 s; these two are together 0.8 % of the release. They are shipped rather than deleted so episode numbering stays stable.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
 
273
  ## Notes
274
- - **Depth** is available in the source recordings and will be added under `data/<task>/depth/` in a later upload.
275
- - One pushT source recording (`episode_004`) was corrupt and excluded.
276
- - The previous single-task `.pt` release (`episodes/`, `segments/`) is superseded by this video format.
 
 
 
 
 
 
 
277
 
278
  ## License
279
  [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/).
 
43
 
44
  ## Format — LeRobot-style video release
45
 
46
+ Each episode ships as **5 MP4 video streams** (640×480, H.264) + a **per-frame parquet** of poses and contact metrics. This matches how LeRobot / DROID / Open X-Embodiment ship manipulation data: tiny on disk (whole dataset ≈ 4.8 GB without depth vs ~1 TB raw), random-access decodable, training-ready.
47
 
48
  ```
49
  data/<task>/
 
92
  | `force_{left,right}_target_pose` | list[7] | that sensor's pose displaced `F/k` along the contact normal (quaternion carried through unchanged) |
93
 
94
  ```python
95
+ import numpy as np, pyarrow.parquet as pq
96
  t = pq.read_table("data/motherboard/meta/2026-05-10/episode_000.parquet")
97
+ f = t["force_left_normal_n"].to_numpy() # (T,) newtons
98
+ obs = np.array(t["sensor_left_pose"].to_pylist()) # (T, 7) xyz + quat
99
+ tgt = np.array(t["force_left_target_pose"].to_pylist()) # (T, 7) the action
100
  ```
101
 
102
+ #### What "force-informed action" means, and how to train on it
103
+
104
+ A policy trained to output `sensor_*_pose` learns **where to go**. It cannot
105
+ learn **how hard to press**, because in this data the two are the same signal:
106
+ a human hand reached a pose, and whatever force resulted was never recorded as
107
+ a separate command. Regressing that pose and replaying it on a compliant robot
108
+ reproduces the trajectory and not the interaction — the same motion against a
109
+ stiffer or differently-placed object produces a different force, and nothing
110
+ in the demonstration says which force was intended.
111
+
112
+ `force_*_target_pose` is that missing command, written in the units a robot
113
+ already accepts:
114
+
115
+ ```
116
+ target = observed + (F / k) · n̂ n̂ = press direction of that sensor,
117
+ R(q_row) @ gel_axis_in_rigid
118
+ ```
119
+
120
+ It is the pose a **stiffness-`k` impedance controller** would have to be
121
+ commanded in order to generate the estimated force `F` against a surface at the
122
+ observed pose. Train the policy to output `target_pose`, deploy it as the
123
+ setpoint of an impedance/admittance controller with the same `k`, and the
124
+ controller produces both the reach and the press. This is the standard trick
125
+ behind position-based force control; the only new part is that `F` came from
126
+ the tactile images rather than from a load cell.
127
+
128
+ ```python
129
+ action = tgt # what the policy predicts
130
+ observation = obs # where the sensor actually was
131
+ # free space: byte-identical, so this is a strict addition to the old target
132
+ assert np.array_equal(action[f == 0], observation[f == 0])
133
+ ```
134
+
135
+ That identity is not a claim — it is checked element-wise over all **301,727**
136
+ free-space rows of the release, maximum deviation `0.0`, quaternions included.
137
+ Nothing changes where nothing is touched, so a model trained on `target_pose`
138
+ degenerates to the pose-only model in free space and differs only in contact.
139
+
140
+ #### Choosing `k` — it is your controller's number, not ours
141
+
142
+ `k = 1.0 N/mm` is a **declared assumption**, recorded in the parquet field
143
+ metadata (`twm.stiffness_n_per_mm`) and in each `<episode>.force.json`, so a
144
+ target pose is never uninterpretable. It is deliberately soft, and at that
145
+ value the implied penetrations are larger than the gel is thick:
146
+
147
+ | | penetration at `k = 1` | inside the 4.25 mm gel? |
148
+ |---|---|---|
149
+ | p95 over all rows | 5.78 mm | no |
150
+ | p95 over **contact** rows | 6.86 mm | no |
151
+ | maximum | 7.285 N → 7.285 mm | no |
152
+
153
+ **8.84%** of all rows exceed the gel thickness at `k = 1`. To keep penetration
154
+ physically plausible you need a stiffer environment model:
155
+
156
+ * `k ≥ 1.37 N/mm` — p95 over all rows inside the gel. *This is the weakest of
157
+ the three and the least useful:* 62.8% of rows are free space, so a
158
+ percentile over all rows is mostly a percentile of zeros.
159
+ * `k ≥ 1.62 N/mm` — p95 over **contact** rows inside the gel. Use this one.
160
+ * `k ≥ 1.72 N/mm` — even the hardest press inside the gel.
161
+
162
+ Recompute rather than rescale the shipped column, since the direction matters:
163
+
164
+ ```python
165
+ K = 1.62 # your controller's stiffness
166
+ n_hat = (tgt[:, :3] - obs[:, :3]) # F/k · n̂ at the shipped k=1
167
+ n_hat /= np.linalg.norm(n_hat, axis=1, keepdims=True) + 1e-12
168
+ my_target = obs.copy()
169
+ my_target[:, :3] = obs[:, :3] + (f / K)[:, None] * n_hat
170
+ ```
171
 
172
  #### Read this before using the numbers
173
 
 
 
 
 
 
 
 
 
 
 
 
174
  - **Accuracy is rank-order within a group, not a certified absolute scale.**
175
+ Held out by press position the estimator scores ρ = 0.739 / MAE 1.23 N on its
176
+ own calibration objects. On five public force-labelled datasets the same
177
  pipeline reaches ρ 0.775–0.986. It is reliable for *how hard, relative to
178
+ other frames*; it is not a load cell. Do not report absolute newtons from
179
+ this dataset as ground truth.
180
+ - **Forces saturate at 7.285 N.** The calibration's isotonic stage clips at the
181
+ hardest press it was fitted on, so 0.90% of samples sit exactly at that value.
182
+ Treat the maximum as a floor, not a measurement, and consider masking rows at
183
+ the ceiling out of a regression loss.
184
  - **Duplicate tactile rows repeat the previous estimate.** The GelSight stream
185
  is slower than 30 Hz; rows with `tactile_{side}_is_new == False` carry the
186
  previous frame's force unchanged (forward fill, asserted exact). Filter on
187
+ `is_new` if you need independent samples — and note that a force *derivative*
188
+ computed without that filter is zero on ~72% of rows by construction.
189
+ - **Row alignment is verified, not assumed.** Every one of the **72/72**
190
+ sensor-sides was checked row-for-row against the release parquet it was
191
+ exported from.
192
+ - **The direction `` comes from calibration, not from the image.** It is the
193
+ sensor's gel axis rotated by the row's own quaternion. Two sensor-sides of 72
194
+ lack a usable gel-to-rigid transform and carry force with no displacement;
195
+ they are identified in `data/force_export_manifest.json`.
 
 
 
 
 
 
196
 
197
  ### depth (optional, `data/<task>/depth/`)
198
  Per-camera depth is shipped as **lossless FFV1 16-bit video** (`gray16le`):
 
222
 
223
  ## Downloading — depth is optional
224
 
225
+ The dataset splits into a **lightweight core** (RGB + tactile + poses, ~4.8 GB) and an **optional depth tree** (`data/<task>/depth/`, ~33 GB lossless). Depth lives in its own subtree so you can skip it entirely.
226
 
227
  ```python
228
  from huggingface_hub import snapshot_download
229
 
230
+ # Core only — RGB + tactile + parquet, NO depth (~4.8 GB)
231
  snapshot_download("yxma/React", repo_type="dataset",
232
  ignore_patterns=["*/depth/*"])
233
 
234
+ # Everything including depth (~39 GB)
235
  snapshot_download("yxma/React", repo_type="dataset")
236
 
237
  # One task only
 
318
  episodes**, spanning both tasks. The same check independently recovers the
319
  +15-frame latency correction baked into the release.
320
 
321
+ ## How to use this dataset
322
+
323
+ Three recipes, in the order most people need them. Every one is executed
324
+ against the published files by `scripts/test_readme_recipes.py`, so the code
325
+ below is code that runs, not code that reads well.
326
+
327
+ ### 1. Sample training clips — start from `segments.json`, not from episodes
328
+
329
+ An episode is a raw recording and contains flagged frames. A **segment** is a
330
+ contiguous span that is already clean. Sampling clips from episodes means
331
+ re-deriving the quality filter yourself and getting it slightly different.
332
+
333
+ ```python
334
+ import json, numpy as np, pyarrow.parquet as pq
335
+
336
+ segs = json.load(open("data/pushT/segments.json"))["segments"]
337
+ s = segs[0] # {'source_episode', 'frame_range', ...}
338
+ date, ep = s["source_episode"].split("/")
339
+ a, b = s["frame_range"] # inclusive, in VIDEO frame coords
340
+
341
+ t = pq.read_table(f"data/pushT/meta/{date}/{ep}.parquet").slice(a, b - a + 1)
342
+ ```
343
+
344
+ `frame_range` indexes the published MP4s and the parquet with the same origin,
345
+ so frame `i` of `view_middle.mp4` is row `i` of the parquet. No offset, no
346
+ lookup table.
347
+
348
+ ### 2. Train on touch — respect the tactile rate
349
+
350
+ Rows are written at 30 Hz; the GelSight stream is slower. A row with
351
+ `tactile_{side}_is_new == False` repeats the previous tactile frame, its
352
+ contact scalars, and its force estimate, unchanged.
353
+
354
+ ```python
355
+ new = t["tactile_left_is_new"].to_numpy()
356
+ # independent tactile samples only
357
+ idx = np.flatnonzero(new)
358
+ # a finite difference over ALL rows is 0 wherever is_new is False, by construction
359
+ ```
360
+
361
+ Roughly 72% of rows are repeats. Ignoring this does not corrupt a model that
362
+ consumes frames independently, but it silently zeroes any temporal derivative
363
+ of a tactile channel and inflates any "how often does touch change" statistic.
364
+
365
+ ### 3. Train an action that includes *how hard*
366
+
367
+ This is the part that distinguishes React from a pose-only demonstration set,
368
+ so it gets its own section: **[estimated contact
369
+ force](#estimated-contact-force-motherboard--pusht-36-episodes)**. In short:
370
+
371
+ ```python
372
+ observation = np.array(t["sensor_left_pose"].to_pylist()) # where it was
373
+ action = np.array(t["force_left_target_pose"].to_pylist()) # where to push to
374
+ ```
375
+
376
+ `action` equals `observation` exactly in free space and leads it by `F/k` along
377
+ the press direction during contact. Train on `action`, deploy through an
378
+ impedance controller of stiffness `k`, and the policy commands both the reach
379
+ and the press. Read that section before choosing `k` — the shipped `k = 1 N/mm`
380
+ is a declared assumption and a soft one.
381
+
382
+ ### What this dataset is not
383
+
384
+ - **No robot.** A human hand holds each sensor. There are no joint angles, no
385
+ gripper state, and no action in the robot-command sense other than the
386
+ force-informed target pose described above.
387
+ - **No force sensor.** Every newton in these files is estimated from tactile
388
+ images. It is calibrated and validated, and it is still an estimate — see the
389
+ limits in the force section before reporting absolute values.
390
+ - **Not a benchmark.** There is no train/val/test split and no success label.
391
+ It is interaction data for dynamics and representation learning.
392
+
393
  ## Data quality
 
394
 
395
+ Per-task `bad_frames.json` marks intervals that should not be trained on, and
396
+ `segments.json` is their complement — contiguous clean spans, already excluding
397
+ every flag below. **Use `segments.json` and you never have to think about
398
+ this table.**
399
+
400
+ | flag | motherboard | pushT |
401
+ |---|---|---|
402
+ | `cam_corruption` | 0 | 0 |
403
+ | `intensity_spikes` | 56 | 10 |
404
+ | `ot_loss_L` | 1,443 | 106 |
405
+ | `ot_loss_R` | 236 | 191 |
406
+ | `pose_teleports_L` | 24 | 0 |
407
+ | `pose_teleports_R` | 16 | 0 |
408
+ | `tactile_corruption` | 102 | 10 |
409
+ | **flagged (union)** | **1,797 / 194,445 (0.92%)** | **307 / 45,595 (0.67%)** |
410
+ | **clean segments** | 81 spans, 192,626 frames (107.0 min) | 17 spans, 45,288 frames (25.2 min) |
411
+ | **dropped, clean but < 16 frames** | 22 | 0 |
412
+
413
+ The three rows above reconcile exactly: flagged + clean + dropped = total, for
414
+ both tasks. Per-flag counts do **not** sum to the flagged total, because one
415
+ frame can trip two detectors; the union is what `summary` reports and what the
416
+ segments complement.
417
+
418
+ `ot_loss_*` is OptiTrack track loss (a run of bit-identical poses, i.e. frozen
419
+ action), `pose_teleports_*` an implausible jump in translation *and* rotation
420
+ in one frame, `intensity_spikes` a GelSight reading above anything contact
421
+ produces. `tactile_corruption` and `cam_corruption` are **video** defects —
422
+ torn frames the sidecar scalars cannot see. They are found by looking for
423
+ off-illumination magenta laid out in scanlines: a GelSight is lit by three
424
+ coloured LEDs, magenta is outside that gamut, and a corrupt row is written
425
+ edge to edge while an object pressed into the gel is not. Every flagged
426
+ interval in this release was also inspected by eye.
427
+
428
+ **Runt episodes.** Two motherboard recordings are far too short to be complete
429
+ demonstrations and are best filtered out: `2026-05-19/episode_003` (4.0 s) and
430
+ `2026-05-19/episode_004` (7.0 s). Median episode length is 213 s; these two are
431
+ together 0.8 % of the release. They are shipped rather than deleted so episode
432
+ numbering stays stable.
433
+
434
+ **A missing pushT episode.** `pushT/2026-06-18/episode_004` was recorded but is
435
+ not published. Its recorder died without closing the file, which loses HDF5's
436
+ metadata cache: 79 GB of intact pixels behind a root object header that was
437
+ never written. All eight image streams were recovered (15,447 frames,
438
+ byte-verified), but only 2 of 16 timestamp chunks survived and no usable
439
+ OptiTrack poses. Without timestamps there is no cross-modal alignment, and
440
+ reconstructing them by interpolation misplaces frames by 15–1431 — so it is
441
+ video, not an episode, and is deliberately absent rather than published
442
+ half-aligned. Episode numbering is unaffected: pushT publishes 000–003.
443
 
444
  ## Notes
445
+ - **Depth is published**, under `data/<task>/depth/<date>/<episode>/depth_*.mkv`
446
+ (16-bit millimetres, FFV1-in-Matroska, lossless). It is 34.3 GB
447
+ of the 39.0 GB repo, so the download recipes above let you skip
448
+ it — everything else is 4.8 GB.
449
+ - The previous single-task `.pt` release (`episodes/`, `segments/`) is
450
+ superseded by this video format.
451
+ - Preview clips under `data/<task>/previews/` are 30 s renders at 2x with the
452
+ three camera views, the OptiTrack skeleton, both GelSight streams and the
453
+ projected sensor position. They are for looking, not for training, and frames
454
+ excluded by `bad_frames.json` are outlined and named in red.
455
 
456
  ## License
457
  [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/).