wzlllong's picture
Consolidate RoboValue subtask annotations and simplify public names (#8)
7b65956
|
Raw History Blame Contribute Delete
4.94 kB
# Subtask Annotations
[简体中文](SUBTASKS_zh.md) · [Dataset overview](README.md)
Each of the six dataset roots has **`annotations/subtasks.json`** (schema v2). Its `tasks` list contains local task indices, task names, instructions, and S-numbered definitions. Each subtask has `subtask_id`, a qualified `definition_id` (`domain/task_key/Sn`), and `definition_en`; original label IDs and wording are retained where needed. `reference` records the [RoboValue source publication](https://arxiv.org/abs/2610.26663) and page references. Definitions alone do not create temporal labels.
| Dataset root | Tasks / definitions | Available temporal labels |
| --- | ---: | --- |
| `training-data/simulation/full-shot` | 15 / 58 | None |
| `training-data/simulation/one-shot` | 15 / 58 | 58 segments and 8,080 frame labels |
| `training-data/real-world/full-shot` | 20 / 97 | None |
| `training-data/real-world/one-shot` | 20 / 97 | None |
| `evaluation/simulation/test-30` | 4 / 19 | 54 existing segments in 12 ED/MS episodes |
| `evaluation/real-world/test-30` | 4 / 21 | 153 existing segments across 30 episodes |
`annotations/subtask_segments.parquet` is available in Simulation One-Shot and both public test roots. Simulation One-Shot additionally provides `annotations/frame_labels.parquet`; its original columns and values are retained. Definitions, temporal labels, and test metric memberships are read separately from LeRobot model observations.
## Read test definitions and intervals
The following example downloads just the definition and interval files, then finds the annotated subtask at frame 100 of real-world episode 0. Change `prefix` to the simulation test root to read its labels. An uncovered frame returns no label. Use the fixed revision shown below for downloading and loading.
```python
import json
from pathlib import Path
import pyarrow.parquet as pq
from huggingface_hub import snapshot_download
repo_id = "wzlllong/value-model-benchmark-training-data"
revision = "3f21eb1beeedaf1b1d5aaacda4a033174521d8c3"
prefix = "evaluation/real-world/test-30"
snapshot = snapshot_download(
repo_id=repo_id, repo_type="dataset", revision=revision,
allow_patterns=[f"{prefix}/annotations/subtasks.json",
f"{prefix}/annotations/subtask_segments.parquet"],
local_dir="./robovalue-subtasks",
)
root = Path(snapshot) / prefix
annotations = json.loads((root / "annotations/subtasks.json").read_text())
definitions = {s["definition_id"]: s for t in annotations["tasks"]
for s in t["subtasks"]}
segments = pq.read_table(root / "annotations/subtask_segments.parquet",
filters=[("episode_index", "=", 0), ("start_frame", "<=", 100),
("end_frame_exclusive", ">", 100)])
for row in segments.to_pylist():
definition = definitions[row["definition_id"]]
print(row["subtask_id"], definition["definition_en"])
```
Test intervals are local, zero-based **`[start_frame, end_frame_exclusive)`** ranges. The table retains `source_segment_index`, `source_subtask_id`, original episode/task indices, and local/global endpoints. It is not a metric-query list: select eligible episodes from the unchanged `annotations/metric_membership.json`. Test source annotations and simulation object/action/arm identities remain in their original files.
## Read Simulation One-Shot frame labels
After the imports and revision above, run:
```python
prefix = "training-data/simulation/one-shot"
snapshot = snapshot_download(
repo_id=repo_id, repo_type="dataset", revision=revision,
allow_patterns=[f"{prefix}/annotations/subtasks.json",
f"{prefix}/annotations/frame_labels.parquet"],
local_dir="./robovalue-subtasks",
)
root = Path(snapshot) / prefix
annotations = json.loads((root / "annotations/subtasks.json").read_text())
labels = pq.read_table(root / "annotations/frame_labels.parquet",
filters=[("episode_index", "=", 0), ("frame_index", "=", 100)])
for row in labels.to_pylist():
task = next(t for t in annotations["tasks"]
if t["task_index"] == row["task_index"])
definition = next(s for s in task["subtasks"]
if s["subtask_id"] == row["subtask_id"])
print(definition["definition_en"], row["boundary_uncertain"])
```
Join frame labels to native samples using **`episode_index` and `frame_index`**; `global_index` matches the LeRobot `index`. Training segments use half-open **`[start_frame, end_frame)`** ranges, so the last included frame is `end_frame - 1`. Initial waiting belongs to the first subtask, and the final subtask extends to the episode end. `boundary_uncertain` preserves the supplied adjustment band.
Indices are local to each subset. An ordinal S-number identifies a stage, not a fixed object across execution orders. Missing temporal labels remain absent, including simulation TRR/MEM intervals; reference definitions and sampling anchors do not supply missing ground truth.