SURE is a local feature matching model with uncertainty estimation. This repository provides the PyTorch model, Lightning testing/training entrypoints, a single-pair demo.
conda create -n sure python=3.8 -y
conda activate sure
# CUDA 11.8 build. Change this line if your CUDA/PyTorch stack is different.
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia -y
pip install -r requirements.txtRun SURE on the bundled ScanNet sample pair:
python runtime_single_pair.py --ckpt_path SURE.ckpt --device cudaThe script writes a visualization to sure_single_pair.png. If CUDA is not available, use:
python runtime_single_pair.py --ckpt_path SURE.ckpt --device cpuUse your own pair:
python runtime_single_pair.py \
--image0 /path/to/image0.jpg \
--image1 /path/to/image1.jpg \
--ckpt_path SURE.ckpt \
--width 640 \
--height 480 \
--device cudaPrepare the ScanNet or MegaDepth test subset first, then place or symlink it under data/{{dataset}}/test.
ln -s /path/to/scannet-1500-testset/* data/scannet/test
ln -s /path/to/megadepth-1500-testset/* data/megadepth/testScanNet:
bash scripts/reproduce_test/indoor.shMegaDepth:
bash scripts/reproduce_test/outdoor.shDirect Python entry:
python test.py \
--data_cfg_path configs/data/scannet_test_1500.py \
--main_cfg_path configs/sure/indoor/sure_base.py \
--ckpt_path SURE.ckpt \
--gpus 1 \
--num_workers 0Prepare MegaDepth training data according to your dataset layout, then run:
bash scripts/reproduce_train/outdoor.shDirect Python entry:
python train.py \
--data_cfg_path configs/data/megadepth_trainval_832.py \
--main_cfg_path configs/sure/outdoor/sure_base.py \
--exp_name sure_outdoor \
--gpus 1If you find SURE useful in your research, please consider citing our paper:
@inproceedings{li2026sure,
author = {Li, Sicheng and Gu, Zaiwang and Zhang, Jie and Guo, Qing and Jiang, Xudong and Cheng, Jun},
title = {{SURE}: Semi-dense {Uncertainty-REfined} Feature Matching},
booktitle = {2026 IEEE International Conference on Robotics and Automation (ICRA)},
year = {2026},
pages = {10267--10274},
doi = {10.1109/ICRA57385.2026.11695914}
}Part of the code is based on EfficientLoFTR and RLE. We thank the authors for their useful source code.