Skip to content

MASt3R-SLAM运行,附完整Docker镜像与代码模型下载

代码

https://github.com/rmurai0610/MASt3R-SLAM

论文

https://arxiv.org/pdf/2412.12392

环境安装步骤(Ubuntu)

(需挂VPN,可以在同局域网windows上用clash配置代理,共享给ubuntu使用)

  1. 安装cuda11.8
  2. 安装conda,miniconda
  3. 配置环境
# 创建python虚拟环境  
conda create \-n mast3r-slam python=3.11  
# 激活虚拟环境  
conda activate mast3r-slam  
# 安装torch  
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1  pytorch-cuda=11.8 -c pytorch -c nvidia  
# 下载代码  
git clone https://github.com/rmurai0610/MASt3R-SLAM.git --recursive  
cd MASt3R-SLAM/  
#if you've clone the repo without --recursive run  
git submodule update --init --recursive  
# 从源码安装第三方包  
pip install -e thirdparty/mast3r  
pip install --no-build-isolation -e thirdparty/in3d  
pip install --no-build-isolation -e .  
cd thirdparty/in3d  
python setup.py install  
# 安装torchcodec加速mp4载入(可选)  
pip install torchcodec==0.1

下载模型

cd MASt3R-SLAM/  
mkdir -p checkpoints/  
wget https://download.europe.naverlabs.com/ComputerVision/MASt3R/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth -P checkpoints/
wget https://download.europe.naverlabs.com/ComputerVision/MASt3R/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric_retrieval_trainingfree.pth -P checkpoints/
wget https://download.europe.naverlabs.com/ComputerVision/MASt3R/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric_retrieval_codebook.pkl -P checkpoints/

运行

# 样例命令  
# python main.py --dataset <path/to/video>.mp4 --config config/base.yaml  
# 将mp4文件放入 download下,运行如下命令,注意文件扩展名需要小写  
python main.py --dataset download/DJI_0083.mp4 --config config/base.yaml  
# 运行结果保存在logs文件夹中

运行过程截图如下,显存占用大于8G小于9G

NVIDIA docker运行

请先在ubuntu系统上安装好nvidia docker

代码下载并解压

MASt3R-SLAM.zip

链接: https://pan.baidu.com/s/1RVa0ByTS3cd3-1O3lrHNkg?pwd=r7jy 提取码: r7jy

docker镜像下载

mast3r-slam-cu118.tar.gz

链接: https://pan.baidu.com/s/18k-5sNaCdgqEHEN68UvY_A?pwd=9527 提取码: 9527

docker镜像导入

# 将镜像保存为 .tar 并直接 gzip 压缩  
# docker save my-image:v1 | gzip > my-image.tar.gz

# 解压并加载  
gunzip -c mast3r-slam-cu118.tar.gz | docker load

启动容器

# 进入到代码根目录执行  
sudo docker run --gpus all   --shm-size=8g  -it -v ./:/app  triplanegaussian:latest /bin/bash

运行Demo

# 激活环境  
conda activate mast3r-slam   
cd /app  
# python main.py --dataset <path/to/video>.mp4 --config config/base.yaml  
python main.py --dataset download/DJI_0083.mp4 --config config/base.yaml

运行生成的点云文件,DJI_0083.ply

链接: https://pan.baidu.com/s/1N3BAm4Zou9V845-AhJIFVg?pwd=9527 提取码: 9527