复现 MODEST 机器人抓取透明物体 单目 ICRA 2025
MODEST 单目透明物体抓取算法,来自ICRA 2025,本文分享它的复现过程。
输入单个视角的RGB图像,模型需要同时处理深度和分割任务,输出透明物体的分割结果和场景深度预测。
论文地址:Monocular Depth Estimation and Segmentation for Transparent Object with Iterative Semantic and Geometric Fusion
代码地址:https://github.com/D-Robotics-AI-Lab/MODEST
将算法迁移到真实机器人平台,开展了透明物体抓取实验。实验平台主要由UR机械臂和深度相机组成。
在借助MODEST方法对透明物体进行分割和深度预测,生成点云数据作为输入,进而采用GraspNet生成抓取位姿。
1、创建Conda环境
使用conda创建一个虚拟环境,名字为modest,指定使用python3.8
然后进入modest环境
conda create -n modest python=3.8
conda activate modest
2、安装torch和CUDA
需要安装torch==1.10.1+cu111,执行下面命令:
pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html
然后安装其他依赖
sudo apt-get install openexr libopenexr-dev
3、安装依赖库requirements.txt
下载MODEST代码到本地,然后解压
打开requirements.txt,注释torch==1.10.1+cu111、torchvision==0.11.2+cu111,因为上面安装了
然后执行命令,安装依赖库
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
4、准备数据集ClearPose
ClearPose 数据集是使用 RealSense L515 摄像头在室内环境中捕获的,捕获了 63 个透明物体。
它包含 RGB、原始深度、地面真实深度、地面真实表面法线图像以及所有物体实例6D位姿。
代码地址:https://github.com/opipari/ClearPose
下载地址:点击下载clearpose
ClearPose 被分成 9 个集合,其中 Set1 只包含化学透明物体,Set2-7 只包含家居物品,Set8-9 还包含其他对抗因素。
文件夹结构如下:
<dataset_path> |-- set1 |-- scene1 |-- metadata.mat # |-- 000000-color.png # RGB image |-- 000000-depth.png # Raw depth image |-- 000000-depth_true.png # Ground truth depth image |-- 000000-label.png # |-- 000000-normal_true.png # ... |-- model |-- <object1> |-- <object1>.obj |-- <object2> |-- <object2>.obj ...
示例数据:
5、下载模型权重
Syn-TODD 数据集上预先训练的模型权重:https://drive.google.com/file/d/1haxiir4PdBNE9Zr1AA4D9bVJ4KCzqa8v/view
真实世界数据集 ClearPose 的模型权重:https://drive.google.com/file/d/1798AE_u6KrMV6mpUGBxz_jaLrg_21A39/view
然后创建文件夹ckpt,放到里面:
6、进行推理
首先配置文件:config/config.json,指定预训练权重ISGNet_clearpose.p
使用CPU运行,"device":"cpu";如果使用GPU,"device":"cuda"
然后在推理代码inference.py中,需要修改图片路径,比如:
image_path = "./datasets/clearpose_downsample_100/set1/scene1/000000-color.png"
推理代码如下
import json
from models.Trainer import Trainer
from utils.visualize import *
image_path = "./datasets/clearpose_downsample_100/set1/scene1/000000-color.png"
################ load the config file ##################
with open('config/config.json', 'r') as f:
config = json.load(f)
############### load the trainer ###############
trainer = Trainer(config)
############### start inference ##############
trainer.inference(image_path)
执行代码:
运行结果,在results目录保存了
原图是这样的
模型预测的深度图:
模型预测的分割效果:
MODEST对透明物体进行分割和深度预测,生成点云数据作为输入,进而采用GraspNet生成抓取位姿。
分享完成~