wzlllong's picture
Document dataset_labeler-compatible simulation annotations
458b08a verified
|
Raw History Blame Contribute Delete
12.4 kB

☰ Simulation One-Shot Subtask Annotations / 仿真 One-Shot 子任务标注

15 tasks · 15 episodes · 58 subtask segments · 8,080 frame labels · 25 FPS

These supplementary annotations label the active semantic subtask in the simulation One-Shot training demonstrations. The English S1…Sn definitions follow RoboValue, Appendix C.2; Chinese text is a translation. Each (task_key, subtask_id) pair has a unique semantic_id.

Label conventions / 标注约定

Item / 项目 Convention / 约定
Frame identity / 帧标识 Zero-based episode_index and frame_index; global_index matches the LeRobot data row index / 从 0 开始,按整数索引关联
Segments / 区间 [start_frame, end_frame) includes the start and excludes the end; inclusive_end_frame = end_frame - 1 / 起始帧包含,末端不包含,包含式末帧等于结束值减 1
Time / 时间 timestamp_seconds = frame_index / 25; one frame is 0.04 seconds / 每帧 0.04 秒
Coverage / 覆盖 One paper subtask per frame; initial waiting belongs to S1, and the final subtask extends to the last episode frame / 每帧一个论文子任务,起始等待并入 S1,最后一个子任务持续至轨迹末帧
Boundary bands / 边界调整带 Typically ±13 frames (0.52 s); Organize Table S4 (keyboard) retains ±25 frames (1 s). boundary_uncertain marks these adjustment bands / 通常 ±13 帧,整理桌面的 S4 键盘步骤保留 ±25 帧,由该布尔字段标记

Only paper subtasks are used; there are no idle, completed, or incomplete-task label classes. Boundary bands describe semantic annotation adjustment, independently of LeRobot's default video-loading tolerance of 0.0001 seconds. They do not remove frames or change the labels.

The accepted boundaries include frame 210 in Store Laptop And Headphones S2, frame 213 in Sweep Blocks S1, and frame 380 in Sweep Blocks S2. Press By Number S1 starts at frame 0 and follows the paper's printed S1–S4 definitions.

这些标签用于仿真 One-Shot 训练示例,与论文评测集标签分开。仅使用论文子任务,没有空闲、任务已完成或任务未完成类别;边界调整带不改变默认视频加载容差,不删除帧。收纳笔记本电脑与耳机的 S2 包含第 210 帧;清扫积木的 S1 包含第 213 帧,S2 包含第 380 帧;按数字按钮的 S1 从第 0 帧开始。

Files / 文件

File / 文件 Contents / 内容
taxonomy.json Paper subtask definitions and task IDs / 论文子任务定义与任务编号
segments.json, segments.parquet 58 labeled intervals / 58 个标注区间
frame_labels.parquet 8,080 labels with integer join keys, text, and boundary mask / 逐帧标签、整数关联键、文本与边界标记
metadata.json Dataset identity and annotation conventions / 数据身份与标注约定
validation.json Coverage, consistency, and accepted-boundary checks / 覆盖、一致性与已确认边界检查
load_subtasks.py Explicit loading, SHA256 validation, and sample lookup / 显式读取、SHA256 校验与帧查询
dataset_labeler/ 15 task-level SIA+CSPC JSON files and a Transfer all boundary export / 15 个任务级兼容 JSON 与 Transfer all 边界点导出
manifest.json SHA256 and byte size of the 23 annotation payload files; the manifest is not self-hashed / 23 个标注文件的校验值与字节数,清单不校验自身

Download and read / 下载与读取

This example downloads only the annotation directory at a fixed revision. It requires huggingface_hub and pyarrow (also installed with LeRobot).

以下示例只下载固定版本的标注目录,不下载视频。需要 huggingface_hub 与 pyarrow,LeRobot 环境已包含这两个依赖。

import importlib.util
import os
from pathlib import Path

from huggingface_hub import snapshot_download

repo_id = "wzlllong/value-model-benchmark-training-data"
prefix = "data/simulation/one-shot"
revision = "7fd21cb2519b4d59cbe9fe8b23cfdf477e3ad145"
local_dir = Path(os.environ.get("ROBOVALUE_LOCAL_DIR", "./robovalue-data"))
snapshot = snapshot_download(
    repo_id=repo_id,
    repo_type="dataset",
    revision=revision,
    allow_patterns=[f"{prefix}/annotations/subtasks/**"],
    local_dir=local_dir,
)
root = Path(snapshot) / prefix
spec = importlib.util.spec_from_file_location(
    "robovalue_subtasks", root / "annotations/subtasks/load_subtasks.py"
)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
annotations = module.load_subtasks(root)
label = annotations.label(episode_index=0, frame_index=0, global_index=0)
print(annotations.table.num_rows, label["semantic_id"], label["subtask_text_en"])

With the matching LeRobot simulation One-Shot dataset loaded as dataset, use label = annotations.for_sample(dataset[0]). The helper checks the episode/frame keys and verifies global_index against the sample's index. For PyArrow, join on episode_index and frame_index and make the same index check. Attach labels before PyTorch batch collation when your training method needs them; LeRobot does not automatically include annotation files in samples.

读取同一版本的仿真 One-Shot LeRobot 数据后,使用 label = annotations.for_sample(dataset[0]) 关联标签;该方法检查轨迹与帧编号,并核对全局数据行索引。训练需要子任务标签时,在 PyTorch batch 合并前显式关联。

dataset_labeler-compatible JSON / 兼容标注格式

The 15 task-level JSON files retain the dataset_labeler SIA+CSPC record format. Each <task_key>_sia_cspc_annotations.json maps a dataset-root-relative head-camera video path to one annotation record. task_key is the canonical simulation task name, including sweep_blocks. Resolve a video key against the local simulation One-Shot dataset root when relocating the files.

15 个任务级 JSON 文件保持 dataset_labeler 的 SIA+CSPC 记录格式;每个 <task_key>_sia_cspc_annotations.json 以相对仿真 One-Shot 数据根目录的头部相机视频路径为键,对应一条轨迹记录。任务名使用发布数据的统一名称,包括 sweep_blocks;移动数据后,由读取者将相对路径与本地数据根目录拼接。

Field / 字段 Meaning / 含义
episode The same dataset-root-relative video path as the object key / 与外层键相同的数据根目录相对视频路径
marks Ordered {"type": "s", "frame": integer, "time": seconds} boundary points / 按顺序排列的子任务边界点
duration Episode duration in seconds / 轨迹时长,单位秒
task Canonical simulation task name / 统一仿真任务名
metric, group SIA+CSPC, one-shot
episode_name Published target episode name, e.g. episode_000000 / 发布的目标轨迹名称
gap Preserved labeler-format parameter: 20 / 保留的标注工具格式参数,值为 20

marks contains frame 0, every segment's exclusive end_frame, and the episode-length terminal point. For N subtasks there are N + 1 points; consecutive points recover [start_frame, end_frame) intervals in S1…Sn order. The terminal point closes the last interval and does not create a completed-task label. time = frame / 25. The accepted boundaries are unchanged: Store Laptop And Headphones uses [0, 111, 211, 551] and Sweep Blocks uses [0, 214, 381, 703]. Their inclusive last frames remain 210, 213, and 380.

marks 包含第 0 帧、各区间的半开结束点,以及等于轨迹帧数的末端点。N 个子任务对应 N + 1 个边界点,相邻点按 S1…Sn 顺序还原 [start_frame, end_frame) 区间;末端点仅闭合最后一个子任务,不增加“任务已完成”标签。time = frame / 25。已确认的标签和边界均保持不变。

exceptional_intervals.json follows the labeler's Transfer all output: a list of 15 {"episode": video_path, "frames": boundary_points} records containing 73 boundary points. Those points close the same 58 intervals; they are not additional subtask labels. The JSON export, segments.json, and frame_labels.parquet describe the same 58 segments / 8,080 labels. This is a portable format export for these training demonstrations; the integer-keyed Parquet files and helper remain available for explicit training-label joins.

exceptional_intervals.json保持标注工具 Transfer all 的列表格式,每条记录为 {"episode": 视频路径, "frames": 边界点列表}。共 15 条轨迹、73 个边界点,对应相同的 58 个子任务区间、8,080 条逐帧标签;边界点不增加标签类别。用于训练时仍可通过整数索引和原读取工具显式关联标签。

After the annotation-only download example above, read the compatibility JSON locally without downloading videos:

运行上方仅下载标注的示例后,可在本地读取兼容 JSON;以下代码不下载或解码视频。

import json

labeler_dir = root / "annotations/subtasks/dataset_labeler"
task_file = sorted(labeler_dir.glob("*_sia_cspc_annotations.json"))[0]
by_video = json.loads(task_file.read_text(encoding="utf-8"))
video_path, record = next(iter(by_video.items()))
points = record["marks"]
intervals = [
    {"subtask_id": f"S{i + 1}", "start_frame": left["frame"],
     "end_frame": right["frame"]}
    for i, (left, right) in enumerate(zip(points, points[1:]))
]
assert intervals[0]["start_frame"] == 0
assert all(part["start_frame"] < part["end_frame"] for part in intervals)
print(record["episode_name"], video_path, intervals)
# Video location, when the training payload is present: root / video_path