File size: 16,621 Bytes
fa24743
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a793af7
fa24743
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
---
license: other
pretty_name: Human Hand Motion Prediction to LeRobot v3
task_categories:
- robotics
tags:
- lerobot
- hand-pose
- egocentric
- human-hand-motion
---

# Dataset Card for Human Hand Motion Prediction to LeRobot v3

## Dataset Description

- **Homepage:** TODO
- **Repository:** TODO
- **Paper:** TODO
- **Point of Contact:** [The11One](https://huggingface.co/The11One)
- **Dataset Format:** LeRobot v3
- **Source:** Human hand motion prediction results consisting of paired NPZ and MP4 files
- **Modalities:** RGB video, left/right wrist pose, camera pose, MANO hand parameters, hand confidence/validity
- **Primary Use:** Human hand motion prediction, vision-to-hand-motion prediction, human hand motion modeling, and VLA/BC research after appropriate action-space mapping

### Dataset Summary

This dataset converts human hand motion prediction outputs into LeRobot v3 format for research on vision-language-action models (VLA), behavior cloning (BC), and human hand motion modeling.

Each raw data segment consists of an MP4 video and an NPZ prediction result file. The MP4 provides continuous first-person visual observations. The NPZ provides per-frame MANO hand parameters, hand presence logits, hand confidence, camera pose encoding, per-frame camera-to-world transformation matrices, camera intrinsics, FPS, and frame count.

The converted LeRobot v3 dataset uses a unified time-series structure. Each frame contains visual observations, an 18-dimensional absolute left/right wrist pose, a per-frame camera-to-world transformation, left/right MANO local pose and shape parameters, and hand confidence and validity flags. The `action` field is defined as the 18-dimensional absolute left/right wrist pose of the next frame.

> **Important:** The `action` field in this dataset is a human hand motion prediction target. It is not a robot joint control command and is not equivalent to the end-effector control command of any robot platform. Before using this dataset for robot VLA/BC training, the action space, coordinate-frame mapping, extrinsic calibration, and training supervision must be defined according to the target robot.

### Supported Tasks

- Vision-to-hand-motion prediction: use current/history `observation.images.ego` and `observation.state` to predict the next-frame wrist pose.
- Human hand motion modeling: use the 18-dimensional wrist state, or combine MANO `pose6d` / `betas` to model a more complete hand pose.
- Hand pose reconstruction and analysis: combine `observation.images.ego_pred`, MANO parameters, and camera geometry.
- VLA / BC research: after action-space mapping, coordinate-frame alignment, and robot calibration, the dataset can be used for robot policy learning research.
- Camera motion and hand motion analysis: use per-frame `observation.camera_c2w`.

### Out-of-Scope Use

- Do not use `action` directly as robot joint positions or robot controller commands.
- Do not assume that `observation.camera_c2w` provides calibration between the robot base frame and the world frame.
- Do not treat `pose_enc` and `camera_c2w` as the same matrix; their transformation directions are opposite.
- When training action prediction models, do not ignore `action_valid`. In particular, do not treat the repeated placeholder target of the last frame as a real next-frame label.
- `hand_valid` is a heuristic validity flag based on a confidence threshold. It is not equivalent to manually verified hand pose correctness.

---

## Dataset Structure

The overall directory structure is shown below. Actual file names, shard counts, and some metadata file layouts depend on the installed LeRobot version.

```text
lerobot_v3/
├── data/
│   └── ...                         # Parquet per-frame data
├── videos/
│   └── ...                         # Video files for video features
└── meta/
    ├── info.json                   # Dataset information and feature definitions
    ├── stats.json                  # Dataset statistics
    ├── tasks.jsonl                 # Task text metadata
    ├── episodes/                   # Episode index and statistics
    ├── episode_metadata/
    │   ├── episode_000000.npz      # Project-specific auxiliary metadata
    │   └── ...
    └── predictions.json            # Raw prediction results and provenance
```

### Feature Schema

Each time step contains the following main features:

| Feature name | Shape | Type | Meaning |
|---|---:|---|---|
| `observation.images.ego` | `(H, W, 3)` | image/video | Current-frame first-person RGB image |
| `observation.images.ego_pred` | `(H, W, 3)` | image/video | Current-frame hand reconstruction RGB image |
| `observation.state` | `(18,)` | float32 | Absolute left/right wrist pose |
| `observation.camera_c2w` | `(4, 4)` | float32 | Current-frame camera-to-world homogeneous transformation |
| `observation.mano_left_pose6d` | `(90,)` | float32 | Left-hand local joint pose |
| `observation.mano_left_betas` | `(10,)` | float32 | Left-hand shape parameters |
| `observation.mano_right_pose6d` | `(90,)` | float32 | Right-hand local joint pose |
| `observation.mano_right_betas` | `(10,)` | float32 | Right-hand shape parameters |
| `observation.hand_confidence` | `(2,)` | float32 | Left/right hand confidence, ordered as `[left, right]` |
| `observation.hand_valid` | `(2,)` | float32 | Left/right hand validity flags generated by a confidence threshold |
| `action` | `(18,)` | float32 | Next-frame absolute left/right wrist pose |
| `action_valid` | `(1,)` | float32 | Action-target validity flag |

Here, `H` is the image height and `W` is the image width. If raw videos have different resolutions, the conversion program can use `--size WxH` to unify the resolution with letterboxing while preserving the original aspect ratio, and it adjusts the saved `camera_K` accordingly.

### MANO Hand Parameter Layout

The raw `hand` array has dimension 218, formed by concatenating 109-dimensional parameters for each hand. The layout for each hand is:

| Parameter | Per-hand dimension | Left-hand indices | Right-hand indices |
|---|---:|---|---|
| Wrist translation | 3 | `[0:3]` | `[109:112]` |
| Wrist global orientation rot6d | 6 | `[3:9]` | `[112:118]` |
| Local joint pose pose6d | 90 | `[9:99]` | `[118:208]` |
| Hand shape parameters betas | 10 | `[99:109]` | `[208:218]` |
| Total | 109 | `[0:109]` | `[109:218]` |

The conversion program stores wrist state separately from local pose and shape parameters, so downstream models can select inputs and prediction targets according to the task.

### observation.state

`observation.state` is an 18-dimensional vector representing the absolute left/right wrist pose at the current time step:

| Dimension range | Content | Dimension |
|---|---|---:|
| `[0:3]` | Left wrist translation | 3 |
| `[3:9]` | Left wrist global orientation rot6d | 6 |
| `[9:12]` | Right wrist translation | 3 |
| `[12:18]` | Right wrist global orientation rot6d | 6 |

That is:

```text
observation.state = [left wrist position, left wrist orientation, right wrist position, right wrist orientation]
```

Characteristics:

1. It uses absolute wrist pose, not displacement relative to the previous frame.
2. Left and right hand states are concatenated into one vector.
3. Wrist positions and orientations come from the raw `hand` data.
4. Wrist positions use the camera coordinate frame, and position units are meters.
5. `observation.state` is not a robot joint state and should not be used directly as a robot joint position control command.

### Action Definition and Temporal Alignment

The current conversion program defines `action` as the absolute left/right wrist pose of the next frame:

```text
action[t] = observation.state[t+1]
```

For an episode of length `T`:

| Frame index | `observation.state` | `action` | `action_valid` |
|---:|---|---|---:|
| 0 | State at frame 0 | State at frame 1 | 1 |
| 1 | State at frame 1 | State at frame 2 | 1 |
| ... | ... | ... | ... |
| T-2 | State at frame T-2 | State at frame T-1 | 1 |
| T-1 | State at frame T-1 | Repeated state at frame T-1 | 0 |

The last frame has no real next frame. Therefore, `action` repeats the current-frame state, and `action_valid=0` marks it as an invalid prediction target. During training, `action_valid` must be used to mask the action loss of the last frame.

`action` is an absolute pose prediction target, not a displacement increment between adjacent frames.

### Camera Geometry

`observation.camera_c2w` has shape `(4, 4)` and represents the homogeneous transformation matrix from the camera coordinate frame to the world coordinate frame at frame `t`:

```text
camera_c2w =
[ R00  R01  R02  tx ]
[ R10  R11  R12  ty ]
[ R20  R21  R22  tz ]
[  0    0    0    1 ]
```

The upper-left `3x3` matrix `R` represents the rotation of the camera relative to the world frame. The first three elements of the last column, `tx`, `ty`, and `tz`, represent the position of the camera origin in the world frame.

The transformation from a point `p_camera` in the camera frame to a point `p_world` in the world frame is:

```text
p_world = R_c2w × p_camera + t_c2w
```

`camera_c2w` is saved per frame because the camera may move over time. Downstream users can use it to transform wrist positions into the world frame, analyze the relationship between camera motion and hand motion, or further align with other sensors or robot coordinate frames when calibration information is available.

> `camera_c2w` only provides the transformation from the camera coordinate frame to the world coordinate frame. It does not itself provide calibration between the robot base frame and this world frame.

### Auxiliary Metadata

- `camera_K`: Camera intrinsic matrix with structure `[[fx, 0, cx], [0, fy, cy], [0, 0, 1]]`. If `--size WxH` is used during conversion, the program adjusts the saved `camera_K` according to the letterbox scaling and translation.
- `pose_enc`: Retains the camera pose encoding and FOV-related information from the raw prediction results. Under the current data convention, its pose component represents the world-to-camera transformation, which is opposite to `camera_c2w`. Do not treat them as the same matrix.
- `hand_presence_logits`: Left/right hand presence logits, which can be used to analyze hand detection or prediction confidence behavior.
- `predictions.json`: Records episode name, frame count, frame rate, video size, whether letterboxing was applied, raw data provenance, model-related information, auxiliary metadata file locations, inference timing, and custom notes.
- `meta/episode_metadata/*.npz`: Stores auxiliary information for each episode, such as `camera_K`, `pose_enc`, and `hand_presence_logits`. Per-frame `camera_c2w` is already stored in the main dataset and is not duplicated in the auxiliary NPZ files.

### hand_confidence and hand_valid

`observation.hand_confidence` stores left/right hand confidence in the order:

```text
[left_confidence, right_confidence]
```

`observation.hand_valid` is computed with a threshold rule:

```text
left_valid  = 1 if left_confidence  >= threshold else 0
right_valid = 1 if right_confidence >= threshold else 0
```

The default threshold is `threshold = 0.5`, corresponding to the command-line argument:

```bash
--hand-valid-threshold 0.5
```

This flag is a heuristic validity judgment based on confidence. It is not equivalent to manually verified hand pose correctness. Stricter data filtering should define new validity rules according to the specific task.

---

## Dataset Creation

### Source Data

- Raw data consists of prediction result NPZ files and corresponding MP4 videos from a human hand motion prediction pipeline.
- MP4 videos are decoded frame by frame, and RGB images are written to `observation.images.ego`.
- Fields such as `hand`, `hand_confidence`, `camera_c2w`, and `camera_K` in the NPZ files are converted into LeRobot v3 per-frame features and episode auxiliary metadata.
- Videos with different resolutions can be unified with `--size WxH` using letterboxing.

### Curation Rationale

The goal of this dataset is to organize human hand motion prediction results into structured LeRobot v3 data suitable for time-series learning while preserving the information needed for subsequent spatial transformations and hand pose reconstruction.

The current data still represents human hand motion data, not robot body action data. If it is used for VLA fine-tuning on a specific robot platform, the action space, coordinate-frame mapping, and training supervision must be further defined.

### Recommended Collection / Curation Standard

The current version may suffer from excessive length, mixed task semantics, and many ineffective actions. Future collection or filtering should follow these guidelines:

1. **Control duration:** For atomic tasks such as grasping, keep each video to 10-20 seconds and focus on the core interaction chain.
2. **Single task per video:** Strictly follow "one video, one task" and avoid mixing multiple different tasks in one video to maintain task purity.
3. **Increase action density:** Remove pauses, hesitation, and ineffective movement, focus on "how the hand completes effective interaction," and increase the effective action density per unit time.

### Data Splits

This Dataset Card does not declare fixed training/validation/test splits. It is recommended to split the dataset by video or episode to avoid evaluation leakage caused by adjacent frames from the same continuous sequence entering different datasets.

---

## Pre-Training Checks

Before formal VLA or BC training, it is recommended to check the following:

1. **Frame count consistency:** Confirm that video frame counts match NPZ prediction frame counts, or clearly record the truncation strategy.
2. **Temporal alignment:** Confirm that each image frame, hand state, and `camera_c2w` correspond to the same time step.
3. **Action offset:** Confirm that `action[t] = observation.state[t+1]`, not the current-frame state.
4. **Last-frame mask:** Confirm that the last frame of each episode has `action_valid=0`.
5. **Coordinate-frame consistency:** Confirm that wrist positions use the camera coordinate frame and that `camera_c2w` transforms from camera to world.
6. **Numerical validity:** Check hand states, camera matrices, and auxiliary features for `NaN` or `Inf`.
7. **Confidence distribution:** Check left/right hand confidence and the distribution of `hand_valid`.
8. **Video size:** Confirm that output image resolutions are consistent across all episodes.
9. **Data splits:** Split training/validation/test sets by video or episode to avoid evaluation leakage.
10. **Action semantics:** Confirm that the downstream model objective matches the current 18-dimensional wrist pose definition, or explicitly implement the necessary action-space conversion.

---

## Considerations for Using the Data

### Personal and Sensitive Information

First-person videos may contain people, workplaces, screen content, or other identifiable information. Before publication or redistribution, confirm that necessary permissions have been obtained and perform anonymization, blurring, or cropping as needed.

### Bias, Risks, and Limitations

- The `action` field is a human hand motion prediction target, not a robot joint control command.
- There is an embodiment gap between human hand motion and robot body actions, requiring action-space mapping and calibration.
- `camera_c2w` does not provide calibration between the robot base frame and the world frame.
- `pose_enc` and `camera_c2w` have opposite transformation directions and cannot be directly mixed.
- `hand_valid` is generated from a confidence threshold and has not been manually verified frame by frame.
- First-person views may contain occlusion, motion blur, hand pauses, and ineffective movement.
- The current data may contain overly long videos, mixed tasks, and insufficient effective action density.
- During training, `action_valid` must be used to mask the action loss of the last frame.

### Licensing Information

License: apache-2.0

### Contact

For questions, please contact: [The11One](https://huggingface.co/The11One).

---

## Loading

When loading with LeRobot, adjust the repository name and LeRobot version as needed:

```python
from lerobot.datasets.lerobot_dataset import LeRobotDataset

ds = LeRobotDataset("The11One/EGO")
print(ds)
```

Before formal training, verify through the generated `info.json`, Parquet data, video files, and `meta/` metadata that all features have been correctly written.