【机器人】复现 UniGoal 具身导航 | 通用零样本目标导航 CVPR 2025

UniGoal的提出了一个通用的零样本目标导航框架,能够统一处理多种类型的导航任务。

支持 对象类别导航实例图像目标导航文本目标导航,而无需针对特定任务进行训练或微调。

本文分享UniGoal复现和模型推理的过程~

查找沙发,模型会根据输入的实例图片进行匹配的

目录

1、创建Conda环境

[2、 安装habitat仿真环境](#2、 安装habitat仿真环境)

3、安装第三方的依赖库

[3.1 安装LightGlue依赖](#3.1 安装LightGlue依赖)

[3.2 安装detectron2依赖](#3.2 安装detectron2依赖)

[3.3 安装Grounded-Segment-Anything依赖](#3.3 安装Grounded-Segment-Anything依赖)

[3.4 安装其他依赖库](#3.4 安装其他依赖库)

4、下载模型权重

5、下载HM3D数据集

[6、安装Ollama,配置LLM 和 VLM](#6、安装Ollama,配置LLM 和 VLM)

7、模型推理


1、创建Conda环境

首先创建一个Conda环境,名字为unigoal,python版本为3.8

进行unigoal环境

bash 复制代码
conda create -n unigoal python=3.8
conda activate unigoal

然后下载unigoal代码,并解压:https://github.com/bagh2178/UniGoal

2、 安装habitat仿真环境

执行下面命令进行安装

bash 复制代码
cd UniGoal
conda install habitat-sim==0.2.3 -c conda-forge -c aihabitat
pip install -e third_party/habitat-lab

安装过程的打印信息:

安装成功啦~

3、安装第三方的依赖库

3.1 安装LightGlue依赖

bash 复制代码
pip install git+https://github.com/cvg/LightGlue.git

正常安装打印的信息:

3.2 安装detectron2依赖

需要cuda>=12.1的,用nvcc --version查询

(unigoal) lgp@lgp-MS-7E07:~/2025_project/UniGoal$ nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2023 NVIDIA Corporation

Built on Mon_Apr__3_17:16:06_PDT_2023

Cuda compilation tools, release 12.1, V12.1.105

Build cuda_12.1.r12.1/compiler.32688072_0

如果是cuda11.x或更底版本的,需要安装或切换为cuda>=12.1的

将以下内容添加到 ~/.bashrc

bash 复制代码
# 设置 CUDA 12.1 为默认版本
export CUDA_HOME=/usr/local/cuda-12.1
export PATH=/usr/local/cuda-12.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH

然后执行:

bash 复制代码
source ~/.bashrc

再安装detectron2:

bash 复制代码
pip install git+https://github.com/facebookresearch/detectron2.git

3.3 安装Grounded-Segment-Anything依赖

执行命令进行安装,等待安装完成~

bash 复制代码
git clone https://github.com/IDEA-Research/Grounded-Segment-Anything.git third_party/Grounded-Segment-Anything
cd third_party/Grounded-Segment-Anything
git checkout 5cb813f
pip install -e segment_anything
pip install --no-build-isolation -e GroundingDINO

3.4 安装其他依赖库

先安装pytorch::faiss-gpu,等待安装完成~

bash 复制代码
conda install pytorch::faiss-gpu

再安装安装其他依赖库

bash 复制代码
pip install -r requirements.txt

2025/5/12 补丁安装:

bash 复制代码
pip install openai mkl faiss-gpu

4、下载模型权重

分别下载sam_vit_h_4b8939.pthgroundingdino_swint_ogc.pth权重,放在data/models目录下

bash 复制代码
cd ../../
mkdir -p data/models
wget -O data/models/sam_vit_h_4b8939.pth https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
wget -O data/models/groundingdino_swint_ogc.pth https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth

等待下载完成:

5、下载HM3D数据集

从这里下载 HM3D 场景数据集,从这里下载实例-图像-目标导航事件数据集。

数据集的结构概述如下:

UniGoal/

└── data/

├── datasets/

│ └── instance_imagenav/

│ └── hm3d/

│ └── v3/

│ └── val/

│ ├── content/

│ │ ├── 4ok3usBNeis.json.gz

│ │ ├── 5cdEh9F2hJL.json.gz

│ │ ├── ...

│ │ └── zt1RVoi7PcG.json.gz

│ └── val.json.gz

└── scene_datasets/

└── hm3d_v0.2/

└── val/

├── 00800-TEEsavR23oF/

│ ├── TEEsavR23oF.basis.glb

│ └── TEEsavR23oF.basis.navmesh

├── 00801-HaxA7YrQdEC/

├── ...

└── 00899-58NLZxWBSpk/

6、安装Ollama,配置LLM 和 VLM

分别执行下面命令:

bash 复制代码
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2-vision

成功啦~

7、模型推理

运行main.py,就可以进行模型推理啦

bash 复制代码
python main.py 

打印信息:

bash 复制代码
[22:03:27:032178]:[Assets] ResourceManager.cpp(2210)::loadMaterials : Idx 26:Flat.
[22:03:27:032183]:[Assets] ResourceManager.cpp(2210)::loadMaterials : Idx 27:Flat.
[22:03:27:062166]:[Sim] Simulator.cpp(442)::instanceStageForSceneAttributes : Successfully loaded stage named : data/scene_datasets/hm3d_v0.2/val/00877-4ok3usBNeis/4ok3usBNeis.basis.glb
[22:03:27:062184]:[Sim] Simulator.cpp(474)::instanceStageForSceneAttributes : 
---
The active scene does not contain semantic annotations : activeSemanticSceneID_ = 0  
---
[22:03:27:062207]:[Sim] Simulator.cpp(208)::reconfigure : CreateSceneInstance success == true for active scene name : data/scene_datasets/hm3d_v0.2/val/00877-4ok3usBNeis/4ok3usBNeis.basis.glb  with renderer.
[22:03:27:067606]:[Nav] PathFinder.cpp(568)::build : Building navmesh with 222 x 162 cells
[22:03:27:121110]:[Nav] PathFinder.cpp(842)::build : Created navmesh with 340 vertices 163 polygons
[22:03:27:121130]:[Sim] Simulator.cpp(898)::recomputeNavMesh : reconstruct navmesh successful
2025-05-12 22:03:27,122 Initializing task InstanceImageNav-v1
[05/12 22:03:27 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml', input=['input1.jpeg'], opts=['MODEL.WEIGHTS', 'detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl', 'MODEL.DEVICE', 'cuda:0'], output=None, video_input=None, webcam=False)
[05/12 22:03:27 d2.checkpoint.detection_checkpoint]: [DetectionCheckpointer] Loading from detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl ...
[22:03:27:595720]:[Sensor] Sensor.cpp(69)::~Sensor : Deconstructing Sensor
Loading episodes from: data/datasets/instance_imagenav/hm3d/v3/val/content/4ok3usBNeis.json.gz
Changing scene: 0/data/scene_datasets/hm3d_v0.2/val/00877-4ok3usBNeis/4ok3usBNeis.basis.glb
rank:0, episode:1, cat_id:0, cat_name:chair

看一下运行效果,查找椅子:

查找不同的椅子,模型会根据输入的实例图片进行匹配的

查找卫生间:

分享完成~

相关文章推荐:

UniGoal 具身导航 | 通用零样本目标导航 CVPR 2025-CSDN博客

【机器人】复现 ECoT 具身思维链推理-CSDN博客

相关推荐
猫头虎3 小时前
5G-A来了!5G信号多个A带来哪些改变?
5g·机器人·web3·aigc·社交电子·能源·量子计算
强化学习与机器人控制仿真14 小时前
Newton GPU 机器人仿真器入门教程(零)— NVIDIA、DeepMind、Disney 联合推出
开发语言·人工智能·python·stm32·深度学习·机器人·自动驾驶
LitchiCheng16 小时前
复刻低成本机械臂 SO-ARM100 单关节控制(附代码)
人工智能·机器学习·机器人
微学AI16 小时前
大模型的应用中A2A(Agent2Agent)架构的部署过程,A2A架构实现不同机器人之间的高效通信与协作
人工智能·架构·机器人·a2a
OpenLoong 开源社区1 天前
技术视界 | 青龙机器人训练地形详解(三):复杂地形精讲之台阶
机器人
2301_786001261 天前
螺旋驱动管道机器人的结构设计
机器人
富唯智能1 天前
复合机器人案例启示:富唯智能如何以模块化创新引领工业自动化新标杆
人工智能·机器人·自动化
cnbestec1 天前
探索Hello Robot开源移动操作机器人Stretch 3的技术亮点与市场定位
机器人
xwz小王子2 天前
Taccel:一个高性能的GPU加速视触觉机器人模拟平台
人工智能·机器人