LeanGate
Accelerating Transformer-Based Monocular SLAM via Geometric Utility Scoring
Project Page | Code | Paper Coming Soon
Overview
LeanGate is a lightweight frame-gating model for transformer-based monocular SLAM. It predicts the geometric utility of an incoming frame before expensive dense reconstruction, allowing the system to skip redundant frames early and significantly reduce computation.
Highlights
- Filters out more than 90% of redundant frames before heavy SLAM processing
- Reduces tracking FLOPs by more than 85%
- Achieves around 5x end-to-end throughput speedup
- Maintains competitive tracking and mapping accuracy
Model
- Checkpoint:
model.pt - Framework: PyTorch
- Task: frame utility scoring for monocular SLAM
- Input: current frame and reference/keyframe features or paired image representation
- Output: geometric utility score used for frame gating
Method
Quick Start
This release lets you download the public LeanGate checkpoint, run LeanGate on prepared TUM, 7SCENES, or EUROC scenes, export sparse RGB manifests, and optionally launch MASt3R-SLAM on the filtered sequence.
1. Install
Use python3 and install a PyTorch version matching your CUDA runtime first.
pip install -e .
pip install -e third_party/MASt3R-SLAM/thirdparty/mast3r
pip install -e third_party/MASt3R-SLAM/thirdparty/in3d
pip install --no-build-isolation -e third_party/MASt3R-SLAM
2. Download the released checkpoint
The public LeanGate checkpoint is hosted at:
- Repo:
ShawnX98/LeanGate - URL:
https://huggingface.co/ShawnX98/LeanGate - File:
leangate.pt
Download it with:
python3 scripts/download_checkpoints.py --output-root checkpoints --repo-id ShawnX98/LeanGate
This will place the checkpoint at:
checkpoints/leangate.pt
3. Run LeanGate on a prepared benchmark dataset
Example for TUM:
python3 scripts/generate_rgb_lists.py \
--dataset-type TUM \
--dataset-root /data/tum \
--output-root outputs/predictions \
--device cuda:0
Supported benchmark inputs:
TUM7SCENESEUROC
Expected dataset layouts are documented in docs/dataset_layouts.md.
4. Run the plain RGB folder demo
For a simple folder of RGB frames:
./demo.sh \
--folder /data/my_rgb_frames \
--output-root outputs/demo \
--device cuda:0
This processes frames in sorted filename order and writes the filtered manifest to:
outputs/demo/leangate/<folder_name>.txt
5. Optional: launch MASt3R-SLAM on the sparse sequence
Single scene:
python3 scripts/run_slam_scene.py \
--dataset-type TUM \
--dataset-root /data/tum \
--scene-id rgbd_dataset_freiburg1_desk \
--predictions-root outputs/predictions \
--output-root outputs/slam
Full dataset:
python3 scripts/run_slam_dataset.py \
--dataset-type TUM \
--dataset-root /data/tum \
--predictions-root outputs/predictions \
--output-root outputs/slam
Outputs
LeanGate inference produces:
outputs/predictions/<dataset_slug>/leangate/<scene>.txtoutputs/predictions/<dataset_slug>/leangate/scores/<scene>_scores.csv
Optional MASt3R-SLAM outputs include:
outputs/slam/<dataset_slug>/leangate/<scene>/trajectory_keyframes.tumoutputs/slam/<dataset_slug>/leangate/<scene>/reconstruction.plyoutputs/slam/<dataset_slug>/leangate/<scene>/run_metadata.jsonoutputs/slam/<dataset_slug>/leangate/summary.csvoutputs/slam/<dataset_slug>/leangate/summary.json