File size: 887 Bytes
85d2ae3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)