Skip to content

PRBonn/2DGS-SLAM

Repository files navigation

Globally Consistent RGB-D SLAM with 2D Gaussian Splatting

Xingguang Zhong · Yue Pan · Liren Jin · Marija Popović · Jens Behley · Cyrill Stachniss

Overview

Tracking & Mapping Map State Update
demo_0.mp4
demo_1.mp4

Abstract

[Click to expand] Recently, 3D Gaussian splatting-based RGB-D SLAM displays remarkable performance of high-fidelity 3D reconstruction. However, the lack of depth rendering consistency and efficient loop closure limits the quality of its geometric reconstructions and its ability to perform globally consistent mapping online. In this paper, we present 2DGS-SLAM, an RGB-D SLAM system using 2D Gaussian splatting as the map representation. By leveraging the depth-consistent rendering property of the 2D variant, we propose an accurate camera pose optimization method and achieve geometrically accurate 3D reconstruction. In addition, we implement efficient loop detection and camera relocalization by leveraging MASt3R, a 3D foundation model, and achieve efficient map updates by maintaining a local active map. Experiments show that our 2DGS-SLAM approach achieves superior tracking accuracy, higher surface reconstruction quality, and more consistent global map reconstruction compared to existing rendering-based SLAM methods, while maintaining high-fidelity image rendering and improved computational efficiency.

Installation

1. Clone the repository

git clone git@github.com:PRBonn/2DGS-SLAM.git
cd 2DGS-SLAM

2. Create conda environment

conda create -n 2dgs-slam python=3.10
conda activate 2dgs-slam

3. Install PyTorch

Install PyTorch with CUDA support matching your system's CUDA version. We tested with PyTorch 2.0+ and CUDA 11.8/12.1. Check your CUDA version with nvcc --version or nvidia-smi.

# Example for CUDA 11.8
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
# Example for CUDA 12.1
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121

4. Install dependencies

PyTorch must already be installed (step 3). The CUDA extensions compile against your environment's Torch, so --no-build-isolation is required:

pip install --no-build-isolation -r requirements.txt
pip install --no-build-isolation ./submodules/dust3r/asmk

5. Download MASt3R checkpoints

bash scripts/download_mast3r.sh

Datasets

YAML configs live under configs/<dataset>/ (replica, scannet, tum). The configs expect data under datasets/; adjust dataset_path in a scene file if you store data elsewhere. Use the download scripts below or point paths manually.

Replica

bash scripts/download_replica.sh

TUM RGB-D

bash scripts/download_tum.sh

ScanNet

ScanNet requires access approval. Apply here, then preprocess:

python scripts/scannet_preprocess.py

Update the raw_folder and processed_folder paths in the script before running.

Usage

Running SLAM

python slam.py --config configs/replica/office0.yaml -v

When running on a headless server, use -w to launch a web-based visualizer (powered by Spark) instead of the GUI:

python slam.py --config configs/replica/office0.yaml -w

Here are some more examples on other datasets:

# TUM RGB-D
python slam.py --config configs/tum/fr3_office.yaml -w

# ScanNet
python slam.py --config configs/scannet/scene0000.yaml -w

# Replica, but only processing the first 200 frames
python slam.py --config configs/replica/office0.yaml -w --range 0 200 1

Running on all scenes without GUI

# Replica
bash scripts/run_replica.sh

# ScanNet
bash scripts/run_scannet.sh

# TUM RGB-D
bash scripts/run_tum.sh

Offline Visualization

Visualize the reconstructed Gaussian map and colorized mesh:

python viser.py --ply_path <path_to_ply> --pose_path <path_to_poses> --mesh_path <path_to_mesh_ply>

Acknowledgement

This project builds upon several excellent open-source projects:

Citation

If you use 2DGS-SLAM for your academic work, please cite:

@article{zhong2026tro,
  title   = {{Globally Consistent RGB-D SLAM with 2D Gaussian Splatting}},
  author  = {Zhong, Xingguang and Pan, Yue and Jin, Liren and Popovi{\'c}, Marija and Behley, Jens and Stachniss, Cyrill},
  journal = {IEEE Transactions on Robotics (TRO)},
  year    = {2026},
  url     = {https://arxiv.org/pdf/2506.00970.pdf}
}

Contact

If you have any questions, feel free to contact:

About

2DGS-SLAM: Globally Consistent RGB-D SLAM with 2D Gaussian Splatting (TRO 2026)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors