🚀 OpenVLA 7B
OpenVLA 7B (openvla-7b
) 是一个开源的视觉-语言-动作模型,它基于 Open X-Embodiment 数据集中的 970K 个机器人操作片段进行训练。该模型以语言指令和相机图像作为输入,生成机器人动作。它支持开箱即用的多机器人控制,并且可以通过(参数高效的)微调快速适应新的机器人领域。
所有 OpenVLA 模型检查点以及我们的 训练代码库 均在 MIT 许可证下发布。
如需了解完整详情,请阅读 我们的论文 并查看 我们的项目页面。
📦 安装指南
在使用 OpenVLA 7B 之前,需要安装一些必要的依赖项。可以使用以下命令安装最小依赖:
pip install -r https://raw.githubusercontent.com/openvla/openvla/main/requirements-min.txt
💻 使用示例
基础用法
以下是一个在 [BridgeV2 环境] 中使用 Widow - X 机器人进行零样本指令跟随的示例,用于加载 openvla-7b
:
from transformers import AutoModelForVision2Seq, AutoProcessor
from PIL import Image
import torch
processor = AutoProcessor.from_pretrained("openvla/openvla-7b", trust_remote_code=True)
vla = AutoModelForVision2Seq.from_pretrained(
"openvla/openvla-7b",
attn_implementation="flash_attention_2",
torch_dtype=torch.bfloat16,
low_cpu_mem_usage=True,
trust_remote_code=True
).to("cuda:0")
image: Image.Image = get_from_camera(...)
prompt = "In: What action should the robot take to {<INSTRUCTION>}?\nOut:"
inputs = processor(prompt, image).to("cuda:0", dtype=torch.bfloat16)
action = vla.predict_action(**inputs, unnorm_key="bridge_orig", do_sample=False)
robot.act(action, ...)
更多示例,包括在你自己的机器人演示数据集上微调 OpenVLA 模型的脚本,请查看 我们的训练仓库。
📚 详细文档
模型概述
用途
OpenVLA 模型以语言指令和机器人工作空间的相机图像作为输入,预测由 7 自由度末端执行器增量组成的(归一化的)机器人动作,形式为 (x, y, z, roll, pitch, yaw, gripper)。要在实际机器人平台上执行,动作需要根据每个机器人、每个数据集计算的统计信息进行 反归一化。更多信息请查看 我们的仓库。
OpenVLA 模型可以零样本控制在 Open - X 预训练混合数据集中出现的特定具身和领域组合的机器人(例如,使用 Widow - X 机器人的 BridgeV2 环境)。在给定最少的演示数据的情况下,也可以针对新任务和机器人设置进行高效的 微调;详情见此。
适用范围外情况:OpenVLA 模型不能零样本泛化到新的(未见过的)机器人具身或预训练混合数据集中未涵盖的设置;在这些情况下,建议在所需设置上收集演示数据集,并对 OpenVLA 模型进行微调。
快速开始
OpenVLA 7B 可以开箱即用地控制预训练混合数据集中涵盖领域的多个机器人。例如,上述代码展示了如何在 [BridgeV2 环境] 中使用 Widow - X 机器人进行零样本指令跟随。
📄 许可证
本项目采用 MIT 许可证。所有 OpenVLA 检查点以及 训练代码库 均在 MIT 许可证下发布。
📖 引用
BibTeX:
@article{kim24openvla,
title={OpenVLA: An Open-Source Vision-Language-Action Model},
author={{Moo Jin} Kim and Karl Pertsch and Siddharth Karamcheti and Ted Xiao and Ashwin Balakrishna and Suraj Nair and Rafael Rafailov and Ethan Foster and Grace Lam and Pannag Sanketi and Quan Vuong and Thomas Kollar and Benjamin Burchfiel and Russ Tedrake and Dorsa Sadigh and Sergey Levine and Percy Liang and Chelsea Finn},
journal = {arXiv preprint arXiv:2406.09246},
year={2024}
}