RoboSteer / examples /read_first_task.py
YanCORANV's picture
Add task-centered previews, getting-started guide, and JSON field reference
85d2ae3 verified
Raw History Blame Contribute Delete
887 Bytes
import csv
import json
from pathlib import Path
root = Path(input("Extracted dataset root: ").strip().strip('"')).expanduser().resolve()
task_path = root / 'Tasks/Level1/full_conditioning_reproduction/text_to_motion_generation/L1_text_to_motion_generation_text_--04DHOI32k_00009_38_121.json'
task = json.loads(task_path.read_text(encoding="utf-8-sig"))
print("Task:", task["metadata"]["task_id"])
print("Instruction:", task["input"]["prompts"]["general_instruction"])
print("Text condition:", task["input"]["modalities"]["text"])
motion = root / task["ground_truth"]["motion_parameters"]
with (motion / "joint_pos.csv").open(encoding="utf-8-sig", newline="") as f:
reader = csv.reader(f)
columns = next(reader)
first_frame = [float(value) for value in next(reader)]
print("Motion directory:", motion)
print("Joint columns:", len(columns))
print("First frame:", first_frame)