LerobotV2.1格式转换V3.0
更新时间:2026-04-23
简介
将LeRobotV2.1格式数据集转换为LeRobotV3.0
功能描述
支持多个数据集粒度并行处理
输入
| 输入 | 含义 |
|---|---|
| input_repoid | 原始数据集repoid |
| input_path | 原始v2.1数据集path |
| output_path | 转换后v3.0数据集path |
输出
| 输入 | 含义 |
|---|---|
| output_path | 单个数据集转换后输出path |
| convert_result | 数据集转换状态:SUCCESS: 成功转换SKIP: 跳过, 当前数据集已经是v3.0格式或已经有转换好的3.0格式数据集在output_path下FAILED: 转换失败 |
示例
Plain Text
1from __future__ import annotations
2
3import os
4import daft
5from daft import col
6
7from daft.aihc.common.udf import aihc_udf
8from daft.aihc.functions.embodied.convert_dataset_v21_to_v30_udf import ConvertDatasetV21ToV30
9
10if __name__ == "__main__":
11 if os.getenv("DAFT_RUNNER", "native") == "ray":
12 import ray
13 ray.init(dashboard_host="0.0.0.0", ignore_reinit_error=True)
14 daft.set_runner_ray()
15 daft.set_execution_config(actor_udf_ready_timeout=6000, min_cpu_per_task=0)
16
17 tasks = {
18 "input_repoid": [
19 "lerobot/aloha_sim_insertion_human/",
20 "lerobot/pusht/",
21 "lerobot/pusht2/"
22 ],
23 "input_path": ["/mnt/pfs/xxx/dataset/lerobot_v2/"] * 3,
24 "output_path": ["/mnt/pfs/xxx/dataset/lerobot_v3_output/"] * 3
25 }
26 num_datasets = len(tasks)
27
28 ds = daft.from_pydict(tasks)
29 ds = ds.into_partitions(num_datasets)
30
31 ds = ds.with_column(
32 "convert_result",
33 aihc_udf(
34 ConvertDatasetV21ToV30,
35 construct_args={
36 },
37 num_cpus=1,
38 batch_size=1,
39 concurrency=num_datasets,
40 use_process=True
41 )(col("input_repoid"), col("input_path"), col("output_path")),
42 )
43
44 ds.show()
调用示例
Plain Text
1#启动命令
2#v2tov3_udf.py 为以上的示例代码
3
4#!/bin/bash
5echo "Start Execution."
6python /mnt/pfs/cxy/test/aihc/embodied_ai/v2_to_v3/v2tov3_opreator.py
7echo "Execution completed."
评价此篇文章
