File size: 16,247 Bytes
4ad5cc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# RoboInter-Data: Intermediate Representation Annotations for Robot Manipulation

Rich, dense, per-frame **intermediate representation annotations** for robot manipulation, built on top of [DROID](https://droid-dataset.github.io/) and [RH20T](https://rh20t.github.io/). Developed as part of the [RoboInter](https://github.com/InternRobotics/RoboInter) project. You can try our [**Online demo**](https://huggingface.co/spaces/wz7in/robointer-demo).

The annotations cover 230k episodes and include: subtasks,
primitive skills, segmentation, gripper/object bounding boxes, placement proposals, affordance boxes,
grasp poses, traces, contact points, etc. And each with a quality rating (Primary / Secondary).

## Dataset Structure

```
RoboInter-Data/

├── Annotation_with_action_lerobotv21/    # [Main] LeRobot v2.1 format (actions + annotations + videos)
│   ├── lerobot_droid_anno/               #   DROID: 152,986 episodes
│   └── lerobot_rh20t_anno/              #   RH20T:  82,894 episodes

├── Annotation_pure/                      # Annotation-only LMDB (no actions/videos)
│   └── annotations/                      #   35 GB, all 235,920 episodes

├── Annotation_raw/                       # Original unprocessed annotations
│   ├── droid_annotation.pkl              #   Raw DROID annotations (~20 GB)
│   ├── rh20t_annotation.pkl              #   Raw RH20T annotations (~11 GB)
│   └── segmentation_npz.zip.*            #   Segmentation masks (~50 GB, split archives)

├── Annotation_demo_app/                  # Small demo subset for online visualization
│   ├── demo_data/                        #   LMDB annotations for 20 sampled videos
│   └── videos/                           #   20 MP4 videos

├── Annotation_demo_larger/               # Larger demo subset for local visualization
│   ├── demo_annotations/                 #   LMDB annotations for 120 videos
│   └── videos/                           #   120 MP4 videos

├── All_Keys_of_Primary.json              # Episode names where all annotations are Primary quality
├── RoboInter_Data_Qsheet.json            # Per-episode quality ratings for each annotation type
├── RoboInter_Data_Qsheet_value_stats.json# Distribution statistics of quality ratings
├── RoboInter_Data_RawPath_Qmapping.json  # Mapping: original data source path -> episode splits & quality
├── range_nop.json                        # Non-idle frame ranges for all 230k episodes
├── range_nop_droid_all.json              # Non-idle frame ranges (DROID only)
├── range_nop_rh20t_all.json              # Non-idle frame ranges (RH20T only)
├── val_video.json                        # Validation set: 7,246 episode names
└── VideoID_2_SegmentationNPZ.json        # Episode video ID -> segmentation NPZ file path mapping
```

---

## 1. Annotation_with_action_lerobotv21 (Recommended)

The primary data format. Contains **actions + observations + annotations** in [LeRobot v2.1](https://github.com/huggingface/lerobot) format (parquet + MP4 videos), ready for policy training.

### Directory Layout

```
lerobot_droid_anno/  (or lerobot_rh20t_anno/)
├── meta/
│   ├── info.json              # Dataset metadata (fps=10, features, etc.)
│   ├── episodes.jsonl         # Episode information
│   └── tasks.jsonl            # Task/instruction mapping
├── data/
│   └── chunk-{NNN}/           # Parquet files (1,000 episodes per chunk)
│       └── episode_{NNNNNN}.parquet
└── videos/
    └── chunk-{NNN}/
        ├── observation.images.primary/
        │   └── episode_{NNNNNN}.mp4
        └── observation.images.wrist/
            └── episode_{NNNNNN}.mp4
```

### Data Fields

| Category | Field | Shape / Type | Description |
|----------|-------|-------------|-------------|
| **Core** | `action` | (7,) float64 | Delta EEF: [dx, dy, dz, drx, dry, drz, gripper] |
| | `state` | (7,) float64 | EEF state: [x, y, z, rx, ry, rz, gripper] |
| | `observation.images.primary` | (180, 320, 3) video | Primary camera RGB |
| | `observation.images.wrist` | (180, 320, 3) video | Wrist camera RGB |
| **Annotation** | `annotation.instruction_add` | string | Structured task language instruction |
| | `annotation.substask` | string | Current subtask description |
| | `annotation.primitive_skill` | string | Primitive skill label (pick, place, push, ...) |
| | `annotation.object_box` | JSON `[[x1,y1],[x2,y2]]` | Manipulated object bounding box |
| | `annotation.gripper_box` | JSON `[[x1,y1],[x2,y2]]` | Gripper bounding box |
| | `annotation.trace` | JSON `[[x,y], ...]` | Future 10-step gripper trajectory |
| | `annotation.contact_frame` | JSON int | Frame index when gripper contacts object |
| | `annotation.contact_points` | JSON `[x, y]` | Contact point pixel coordinates |
| | `annotation.affordance_box` | JSON `[[x1,y1],[x2,y2]]` | Gripper box at contact frame |
| | `annotation.state_affordance` | JSON `[x,y,z,rx,ry,rz]` | 6D EEF state at contact frame |
| | `annotation.placement_proposal` | JSON `[[x1,y1],[x2,y2]]` | Target placement bounding box |
| | `annotation.time_clip` | JSON `[[s,e], ...]` | Subtask temporal segments |
| **Quality** | `Q_annotation.*` | string | Quality rating: `"Primary"` / `"Secondary"` / `""` |

### Quick Start
The dataloader is located at our RoboInter [Codebase](https://github.com/InternRobotics/RoboInter/blob/main/RoboInterData/lerobot_dataloader).

```python
from lerobot_dataloader import create_dataloader

# Single dataset
dataloader = create_dataloader(
    "path/to/Annotation_with_action_lerobotv21/lerobot_droid_anno",
    batch_size=32,
    action_horizon=16,
)

for batch in dataloader:
    images = batch["observation.images.primary"]   # (B, H, W, 3)
    actions = batch["action"]                      # (B, 16, 7)
    trace = batch["annotation.trace"]              # JSON strings
    skill = batch["annotation.primitive_skill"]    # List[str]
    break

# Multiple datasets (DROID + RH20T)
dataloader = create_dataloader(
    [
        "path/to/lerobot_droid_anno",
        "path/to/lerobot_rh20t_anno",
    ],
    batch_size=32,
    action_horizon=16,
)
```

### Filtering by Quality & Frame Range

```python
from lerobot_dataloader import create_dataloader, QAnnotationFilter

dataloader = create_dataloader(
    "path/to/lerobot_droid_anno",
    batch_size=32,
    range_nop_path="path/to/range_nop.json",       # Remove idle frames
    q_filters=[
        QAnnotationFilter("Q_annotation.trace", ["Primary"]),
        QAnnotationFilter("Q_annotation.gripper_box", ["Primary", "Secondary"]),
    ],
)
```

For full dataloader documentation and transforms, see: [RoboInterData/lerobot_dataloader](https://github.com/InternRobotics/RoboInter/tree/main/RoboInterData/lerobot_dataloader).

### Format Conversion Scripts

The LeRobot v2.1 data was converted using:

- **DROID**: [convert_droid_to_lerobot_anno_fast.py](https://github.com/InternRobotics/RoboInter/blob/main/RoboInterData/convert_to_lerobot/convert_droid_to_lerobot_anno_fast.py)
- **RH20T**: [convert_rh20t_to_lerobot_anno_fast.py](https://github.com/InternRobotics/RoboInter/blob/main/RoboInterData/convert_to_lerobot/convert_rh20t_to_lerobot_anno_fast.py)

---

## 2. Annotation_pure (Annotation-Only LMDB)

Contains **only the intermediate representation annotations** (no action data, no videos) stored as a single LMDB database. Useful for lightweight access to annotations or as input for the LeRobot conversion pipeline. The format conversion scripts and corresponding lightweight dataloader functions are provided in [lmdb_tool](https://github.com/InternRobotics/RoboInter/blob/main/RoboInterData/lmdb_tool). You can downloade high-resolution
videos by following [Droid hr_video_reader](https://github.com/InternRobotics/RoboInter/blob/main/RoboInterData/hr_video_reader) and [RH20T API](https://github.com/rh20t/rh20t_api).

### Data Format

Each LMDB key is an episode name (e.g., `"3072_exterior_image_1_left"`). The value is a dict mapping frame indices to per-frame annotation dicts:

```python
{
    0: {  # frame_id
        "time_clip": [[0, 132], [132, 197], [198, 224]],   # subtask segments
        "instruction_add": "pick up the red cup",           # language instruction
        "substask": "reach for the cup",                    # current subtask
        "primitive_skill": "reach",                         # skill label
        "segmentation": None,                               # (stored separately in Annotation_raw)
        "object_box": [[45, 30], [120, 95]],                # manipulated object bbox
        "placement_proposal": [[150, 80], [220, 140]],      # target placement bbox
        "trace": [[x, y], ...],                             # next 10 gripper waypoints
        "gripper_box": [[60, 50], [100, 80]],               # gripper bbox
        "contact_frame": 101,                               # contact event frame (−1 if past contact)
        "state_affordance": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6],# 6D EEF state at contact
        "affordance_box": [[62, 48], [98, 82]],             # gripper bbox at contact frame
        "contact_points": [[75, 65], [85, 65]],             # contact pixel coordinates
        ...
    },
    1: { ... },
    ...
}
```

### Reading LMDB

```python
import lmdb
import pickle

lmdb_path = "Annotation_pure/annotations"
env = lmdb.open(lmdb_path, readonly=True, lock=False, readahead=False)

with env.begin() as txn:
    # List all episode keys
    cursor = txn.cursor()
    for key, value in cursor:
        episode_name = key.decode("utf-8")
        episode_data = pickle.loads(value)

        # Access frame 0
        frame_0 = episode_data[0]
        print(f"{episode_name}: {frame_0['instruction_add']}")
        print(f"  object_box: {frame_0['object_box']}")
        print(f"  trace: {frame_0['trace'][:3]}...")  # first 3 waypoints
        break

env.close()
```

### CLI Inspection Tool

```bash
cd RoboInter/RoboInterData/lmdb_tool

# Basic info
python read_lmdb.py --lmdb_path Annotation_pure/annotations --action info

# View a specific episode
python read_lmdb.py --lmdb_path Annotation_pure/annotations --action item --key "3072_exterior_image_1_left"

# Field coverage statistics
python read_lmdb.py --lmdb_path Annotation_pure/annotations --action stats --key "3072_exterior_image_1_left"

# Multi-episode summary
python read_lmdb.py --lmdb_path Annotation_pure/annotations --action summary --limit 100
```

---

## 3. Annotation_raw (Original Annotations)

The original, unprocessed annotation files before conversion to LMDB format. These files are large and slow to load.

| File | Size | Description |
|------|------|-------------|
| `droid_annotation.pkl` | ~20 GB | Raw DROID intermediate representation annotations |
| `rh20t_annotation.pkl` | ~11 GB | Raw RH20T intermediate representation annotations |
| `segmentation_npz.zip.*` | ~50 GB | Object segmentation masks (split archives) |

### Reading Raw PKL
```bash
cd /RoboInter-Data/Annotation_raw
cat segmentation_npz.zip.* > segmentation_npz.zip
unzip segmentation_npz.zip
```

```python
import pickle

with open("Annotation_raw/droid_annotation.pkl", "rb") as f:
    droid_data = pickle.load(f)  # Warning: ~20 GB, takes several minutes

# droid_data[episode_key] contains raw intermediate representation data
# including: all_language, all_gripper_box, all_grounding_box, all_contact_point, all_traj, etc.
```

> To convert raw PKL to the LMDB format used in `Annotation_pure`, see the conversion script in the [RoboInter repository](https://github.com/InternRobotics/RoboInter).

---

## 4. Demo Subsets (Annotation_demo_app & Annotation_demo_larger)

Pre-packaged subsets for quick visualization using the [RoboInterData-Demo](https://github.com/InternRobotics/RoboInter/tree/main/RoboInterData-Demo) Gradio app. Both subsets share the same LMDB annotation format + MP4 video structure.

| Subset | Videos | Size | Use Case |
|--------|--------|------|----------|
| `Annotation_demo_app` | 20 | ~929 MB | HuggingFace Spaces [online demo](https://huggingface.co/spaces/wz7in/robointer-demo) |
| `Annotation_demo_larger` | 120 | ~12 GB | Local visualization with more examples |

### Running the Visualizer

```bash
git clone https://github.com/InternRobotics/RoboInter.git
cd RoboInter/RoboInterData-Demo

# Option A: Use the small demo subset (for Spaces)
ln -s /path/to/Annotation_demo_app/demo_data ./demo_data
ln -s /path/to/Annotation_demo_app/videos ./videos

# Option B: Use the larger demo subset (for local)
ln -s /path/to/Annotation_demo_larger/demo_annotations ./demo_data
ln -s /path/to/Annotation_demo_larger/videos ./videos

pip install -r requirements.txt
python app.py
# Open http://localhost:7860
```

The visualizer supports all annotation types: object segmentation masks, gripper/object/affordance bounding boxes, trajectory traces, contact points, grasp poses, and language annotations (instructions, subtasks, primitive skills).

---

## 5. Metadata JSON Files

### Quality & Filtering

| File | Description |
|------|-------------|
| `All_Keys_of_Primary.json` | List of 65,515 episode names where **all** annotation types are rated Primary quality. |
| `RoboInter_Data_Qsheet.json` | Per-episode quality ratings for every annotation type. Each entry contains `Q_instruction_add`, `Q_substask`, `Q_trace`, etc. with values `"Primary"`, `"Secondary"`, or `null`. |
| `RoboInter_Data_Qsheet_value_stats.json` | Distribution of quality ratings across all episodes. |
| `RoboInter_Data_RawPath_Qmapping.json` | Mapping from original data source paths to episode splits and their quality ratings. |

### Frame Ranges (Idle Frame Removal)

| File | Description |
|------|-------------|
| `range_nop.json` | Non-idle frame ranges for all 235,920 episodes (DROID + RH20T). |
| `range_nop_droid_all.json` | Non-idle frame ranges for DROID episodes only. |
| `range_nop_rh20t_all.json` | Non-idle frame ranges for RH20T episodes only. |

Format: `{ "episode_name": [start_frame, end_frame, valid_length] }`

```python
import json

with open("range_nop.json") as f:
    range_nop = json.load(f)

# Example: "3072_exterior_image_1_left": [12, 217, 206]
# Means: valid action frames are 12~217, total 206 valid frames
# (frames 0~11 and 218+ are idle/stationary)
```

### Other

| File | Description |
|------|-------------|
| `val_video.json` | List of 7,246 episode names reserved for the validation set. |
| `VideoID_2_SegmentationNPZ.json` | Mapping from episode video ID to the corresponding segmentation NPZ file path in `Annotation_raw/segmentation_npz`. `null` if no segmentation is available. |

---

## Related Resources

| Resource | Link |
|----------|------|
| Project | [RoboInter](https://github.com/InternRobotics/RoboInter) |
| VQA Dataset | [RoboInter-VQA](https://huggingface.co/datasets/InternRobotics/RoboInter-VQA) |
| VLM Checkpoints | [RoboInter-VLM](https://huggingface.co/InternRobotics/RoboInter-VLM) |
| LMDB Tool | [RoboInterData/lmdb_tool](https://github.com/InternRobotics/RoboInter/tree/main/RoboInterData/lmdb_tool) |
| High-Resolution Video Reader | [RoboInterData/hr_video_reader](https://github.com/InternRobotics/RoboInter/tree/main/RoboInterData/hr_video_reader) |
| LeRobot DataLoader | [RoboInterData/lerobot_dataloader](https://github.com/InternRobotics/RoboInter/tree/main/RoboInterData/lerobot_dataloader) |
| LeRobot Conversion | [RoboInterData/convert_to_lerobot](https://github.com/InternRobotics/RoboInter/tree/main/RoboInterData/convert_to_lerobot) |
| Demo Visualizer | [RoboInterData-Demo](https://github.com/InternRobotics/RoboInter/tree/main/RoboInterData-Demo) |
| Online Demo | [HuggingFace Space](https://huggingface.co/spaces/wz7in/robointer-demo) |
| Raw DROID Dataset | [droid-dataset.github.io](https://droid-dataset.github.io/) |
| Raw RH20T Dataset | [rh20t.github.io](https://rh20t.github.io/) |

## License

Please refer to the original dataset licenses for [RoboInter](https://github.com/InternRobotics/RoboInter), [DROID](https://droid-dataset.github.io/), and [RH20T](https://rh20t.github.io/).