MASt3R-SLAM

rmurai0610长期未更新

基于 MASt3R 三维重建先验的实时稠密 SLAM 系统,能在单目视频流中同步完成相机位姿估计与稠密三维重建,适合机器人和 AR 场景。

[CVPR 2025] MASt3R-SLAM: Real-Time Dense SLAM with 3D Reconstruction Priors

暂无版本3,242star +5 / 7 天381fork同步于 2026-11-10 17:43 UTC

怎么上手

由 README 提炼,执行前请确认
conda create -n mast3r-slam python=3.11
conda activate mast3r-slam
git clone https://github.com/rmurai0610/MASt3R-SLAM.git --recursive
cd MASt3R-SLAM/
pip install -e thirdparty/mast3r
pip install -e thirdparty/in3d
pip install --no-build-isolation -e .
硬件要求按 README 说明

README 未明确给出显存要求;实验在 RTX 4090 上完成,并提示换用不同 GPU 性能可能有差异。需要 CUDA 环境,安装时按 nvcc 版本选择对应 PyTorch CUDA 版本。

需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 MASt3R 三维重建先验的实时稠密 SLAM 系统,可直接处理视频、图像序列和 RealSense 实时流

基于 MASt3R 三维重建先验的实时稠密 SLAM 系统,能在单目视频流中同步完成相机位姿估计与稠密三维重建,适合机器人和 AR 场景。

核心能力

  • 用 MASt3R 重建先验做稠密 SLAM 跟踪与建图
  • 支持 MP4 视频、RGB 图像文件夹和 RealSense 实时输入
  • 可传入 intrinsics.yaml 使用已知相机内参
  • 提供 TUM、7-Scenes、EuRoC、ETH3D 数据集下载与评测脚本
  • 支持带标定与无标定两种评测模式

容易踩的坑

克隆时必须加 --recursive 拉取子模块,否则需手动 git submodule update --init --recursive;运行前需自行 wget 下载 MASt3R 与 retrieval 三个 checkpoint 到 checkpoints/ 目录;PyTorch 的 CUDA 版本必须与 nvcc 显示的版本匹配;WSL 用户需切到 windows 分支以关闭多进程避免共享内存问题。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Getting Started

    Installation

    conda create -n mast3r-slam python=3.11
    conda activate mast3r-slam
    

    Check the system's CUDA version with nvcc

    nvcc --version
    

    Install pytorch with matching CUDA version following:

    # CUDA 11.8
    conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1  pytorch-cuda=11.8 -c pytorch -c nvidia
    # CUDA 12.1
    conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.1 -c pytorch -c nvidia
    # CUDA 12.4
    conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.4 -c pytorch -c nvidia
    

    Clone the repo and install the dependencies.

    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 -e thirdparty/in3d
    pip install --no-build-isolation -e .
     
    
    # Optionally install torchcodec for faster mp4 loading
    pip install torchcodec==0.1
    

    Setup the checkpoints for MASt3R and retrieval. The license for the checkpoints and more information on the datasets used is written here.

    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/
    

    WSL Users

    We have primarily tested on Ubuntu. If you are using WSL, please checkout to the windows branch and follow the above installation.

    git checkout windows
    

    This disables multiprocessing which causes an issue with shared memory as discussed here.

    Examples

    bash ./scripts/download_tum.sh
    python main.py --dataset datasets/tum/rgbd_dataset_freiburg1_room/ --config config/calib.yaml
    

    Live Demo

    Connect a realsense camera to the PC and run

    python main.py --dataset realsense --config config/base.yaml
    

    Running on a video

    Our system can process either MP4 videos or folders containing RGB images.

    python main.py --dataset <path/to/video>.mp4 --config config/base.yaml
    python main.py --dataset <path/to/folder> --config config/base.yaml
    

    If the calibration parameters are known, you can specify them in intrinsics.yaml

    python main.py --dataset <path/to/video>.mp4 --config config/base.yaml --calib config/intrinsics.yaml
    python main.py --dataset <path/to/folder> --config config/base.yaml --calib config/intrinsics.yaml
    

    Downloading Dataset

    TUM-RGBD Dataset

    bash ./scripts/download_tum.sh
    

    7-Scenes Dataset

    bash ./scripts/download_7_scenes.sh
    

    EuRoC Dataset

    bash ./scripts/download_euroc.sh
    

    ETH3D SLAM Dataset

    bash ./scripts/download_eth3d.sh
    

    Running Evaluations

    All evaluation script will run our system in a single-threaded, headless mode. We can run evaluations with/without calibration:

    TUM-RGBD Dataset

    bash ./scripts/eval_tum.sh 
    bash ./scripts/eval_tum.sh --no-calib
    

    7-Scenes Dataset

    bash ./scripts/eval_7_scenes.sh 
    bash ./scripts/eval_7_scenes.sh --no-calib
    

    EuRoC Dataset

    bash ./scripts/eval_euroc.sh 
    bash ./scripts/eval_euroc.sh --no-calib
    

    ETH3D SLAM Dataset

    bash ./scripts/eval_eth3d.sh 
    

    Reproducibility

    There might be minor differences between the released version and the results in the paper after developing this multi-processing version. We run all our experiments on an RTX 4090, and the performance may differ when running with a different GPU.

    Acknowledgement

    We sincerely thank the developers and contributors of the many open-source projects that our code is built upon.

    Citation

    If you found this code/work to be useful in your own research, please considering citing the following:

    @inproceedings{murai2024_mast3rslam,
      title={{MASt3R-SLAM}: Real-Time Dense {SLAM} with {3D} Reconstruction Priors},
      author={Murai, Riku and Dexheimer, Eric and Davison, Andrew J.},
      booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
      year={2025},
    }