OmTrackVLA 是一个完全开源的 Vision-Language-Action(VLA)导航栈:将单目视频与自然语言指令转化为可执行的短视距 waypoint 序列,用于机器人视觉导航与目标跟随。本仓库适配的是其高效 0.6B 检查点(OmTrackVLA 0.6B Planner),并完成 华为昇腾 Ascend 910 NPU 上的部署与 CPU 精度/性能对比验证。
| 项目 | 内容 |
|---|---|
| 上游模型 | omlab/OmTrackVLA-0.6B(MIT) |
| 论文 | arXiv 2509.12129(基于 TrackVLA 思想的开源社区实现) |
| 任务 | waypoint 预测(robotics / navigation / embodied-ai) |
| 架构 | Qwen3-0.6B LLM 骨干(冻结,28 层,hidden 1024)+ CrossModalityProjector(视觉 1536→1024)+ TVI 时间/视角/类型嵌入 + PlannerHead3L(3 层 MLP,tanh 激活) |
| 参数量 | 609.2M(LLM 310 键 + proj/tvi/act_token/planner 头 23 键) |
| 输入 | coarse_tokens (B,124,1536)+coarse_tidx(31 帧历史×4 token)、fine_tokens (B,64,1536)+fine_tidx(当前帧)、instructions(自然语言列表) |
| 输出 | waypoints (B, 8, 3)——8 个未来路径点(x/y/角度增量,经 alpha_task 缩放) |
注:视觉前端(SigLIP-so400m + DINOv3 → 1536 维 token)不在 checkpoint 内,属模型的外部输入接口;上游训练/评测通过 cache_gridpool.py 预提取。
| 组件 | 版本 |
|---|---|
| NPU | Ascend 910 ×2(64GB HBM) |
| CANN | 8.5.1 |
| torch | 2.9.0 |
| torch_npu | 2.9.0.post1 |
| transformers / Python | 4.57.6 / 3.11 |
qwen3 架构,升级至 4.57.6 后 Qwen3Config/Qwen3Model 可用(pip install transformers==4.57.6 -i https://mirrors.aliyun.com/pypi/simple/)。llm_name 指向作者内部路径(/data23/.../Qwen3-0.6B-local),加载前重定向到本地 Qwen3-0.6B 骨干目录(仅需 config+tokenizer,LLM 权重已在 checkpoint 内)。model.py 用 torch.cuda.is_available() 选 bf16——在 NPU 进程下返回 False,走 fp32 路径,无需补丁即可正确运行;本适配统一 fp32 推理。OpenTrackVLAForWaypoint 自带 _maybe_prefix_state_dict 钩子,自动为旧格式键补 model. 前缀,from_pretrained 直载。# 1. 准备目录与权重(规划器权重 ~1.2GB,已放入 models/,不随仓库分发)
mkdir -p /data/OmTrackVLA-0.6B && cd /data/OmTrackVLA-0.6B
HF_ENDPOINT=https://hf-mirror.com HF_HUB_DOWNLOAD_TIMEOUT=120 python -c \
"from huggingface_hub import snapshot_download; snapshot_download('omlab/OmTrackVLA-0.6B', local_dir='models')"
# 2. 下载 Qwen3-0.6B 骨干 config/tokenizer(LLM 权重已在 checkpoint 内,仅需配置)
HF_ENDPOINT=https://hf-mirror.com python -c \
"from huggingface_hub import snapshot_download; snapshot_download('Qwen/Qwen3-0.6B', local_dir='qwen3_local')"
# 3. 克隆上游源码(提供 model.py 的依赖)
git clone https://github.com/om-ai-lab/OmTrackVLA.git om_repo
# 4. 安装依赖(transformers 必须 >= 4.57,含 qwen3 架构)
pip install -r requirements.txt
# 5. 运行推理(合成视觉 token + 3 条指令,回归 waypoint)
python inference.py --device npu # NPU 推理 + 自动精度对比
python inference.py --device cpu # CPU 推理 + 自动精度对比import sys, torch
sys.path.insert(0, "om_repo")
from models.configuration_open_trackvla import OpenTrackVLAConfig
from models.modeling_open_trackvla import OpenTrackVLAForWaypoint
cfg = OpenTrackVLAConfig.from_pretrained("models")
cfg.llm_name = "qwen3_local" # 重定向到本地 Qwen3 骨干
model = OpenTrackVLAForWaypoint.from_pretrained("models", config=cfg)
model = model.float().to("npu").eval() # 或 "cpu"
waypoints = model(
coarse_tokens=torch.randn(1, 124, 1536, device="npu"), # 31 帧 × 4 token
coarse_tidx=torch.arange(124, device="npu").repeat_interleave(4)[:124],
fine_tokens=torch.randn(1, 64, 1536, device="npu"), # 当前帧 64 token
fine_tidx=torch.full((1, 64), 31, device="npu"),
instructions=["follow the red suitcase ahead of you"],
) # -> (1, 8, 3)测试条件:PIL 合成 31+1 帧走廊场景经确定性投影生成视觉 token,3 条自然语言指令,fp32,各 4 次前向(首次含预热 + 3 次稳态取均值)。
| 输出 | cos_sim | max_abs_err | mean_abs_err |
|---|---|---|---|
| waypoints(全部 3 指令,8×3 展平) | 1.000000 | 0.000394 | 0.000085 |
| instr 0 "follow the red suitcase ahead of you" | 0.999999 | 0.000371 | 0.000099 |
| instr 1 "navigate to the wooden door on the left" | 1.000000 | 0.000256 | 0.000065 |
| instr 2 "move forward and stop beside the blue chair" | 1.000000 | 0.000394 | 0.000091 |
| 指标 | CPU (fp32) | NPU (fp32) | NPU 加速比 |
|---|---|---|---|
| 稳态单次前向(3 指令批) | 1.700 s | 0.064 s | 26.6× |
| 首次前向(含算子编译) | 1.731 s | 0.324 s | 5.3× |
所有输出 cos_sim ≥ 0.9999,mean_abs_err ≤ 1e-4,处于 fp32 舍入误差范围,NPU 与 CPU 精度对齐。
├── inference.py # NPU/CPU 推理 + 精度对比(--device npu|cpu)
├── make_assets.py # 生成 assets/ 信息图
├── requirements.txt # Python 依赖
├── readme.md # 本文件
├── assets/
│ ├── agent_workflow.png # 适配工作流
│ ├── npu_device_call.png # NPU 设备与推理证据
│ └── model_result.png # 模型结果信息图
├── outputs/ # 推理输出(npz/json,gitignore)
├── models/ # 规划器权重 + modeling 代码(gitignore)
├── qwen3_local/ # Qwen3 骨干 config/tokenizer(gitignore)
└── om_repo/ # 上游源码(gitignore)@article{omtrackvla2025,
title={OmTrackVLA: Visual Navigation \& Following for Everyone},
author={{Om AI Lab}},
journal={arXiv preprint arXiv:2509.12129},
year={2025}
}