MCPcopy Index your code
hub / github.com/Parskatt/DKM

github.com/Parskatt/DKM @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
222 symbols 882 edges 50 files 18 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DKM: Dense Kernelized Feature Matching for Geometry Estimation

Project Page | Paper

DKM: Dense Kernelized Feature Matching for Geometry Estimation
Johan Edstedt, Ioannis Athanasiadis, Mårten Wadenbäck, Michael Felsberg
CVPR 2023

WARNING: DKM is trained on a specific resolution, and is sensitive to the image resolution used. This means that feeding images of a different resolution (higher or lower), may give significantly worse performance. If you're finding DKM to give poor performance, please contact me, it's probably something to do with the input.

How to Use?

Our model produces a dense (for all pixels) warp and certainty.

Warp: [B,H,W,4] for all images in batch of size B, for each pixel HxW, we ouput the input and matching coordinate in the normalized grids [-1,1]x[-1,1].

Certainty: [B,H,W] a number in each pixel indicating the matchability of the pixel.

See demo for two demos of DKM.

See api.md for API.

Qualitative Results

https://user-images.githubusercontent.com/22053118/223748279-0f0c21b4-376a-440a-81f5-7f9a5d87483f.mp4

https://user-images.githubusercontent.com/22053118/223748512-1bca4a17-cffa-491d-a448-96aac1353ce9.mp4

https://user-images.githubusercontent.com/22053118/223748518-4d475d9f-a933-4581-97ed-6e9413c4caca.mp4

https://user-images.githubusercontent.com/22053118/223748522-39c20631-aa16-4954-9c27-95763b38f2ce.mp4

Benchmark Results

Megadepth1500

@5 @10 @20
DKMv1 54.5 70.7 82.3
DKMv2 56.8 72.3 83.2
DKMv3 (paper) 60.5 74.9 85.1
DKMv3 (this repo) 60.0 74.6 84.9

Megadepth 8 Scenes

@5 @10 @20
DKMv3 (paper) 60.5 74.5 84.2
DKMv3 (this repo) 60.4 74.6 84.3

ScanNet1500

@5 @10 @20
DKMv1 24.8 44.4 61.9
DKMv2 28.2 49.2 66.6
DKMv3 (paper) 29.4 50.7 68.3
DKMv3 (this repo) 29.8 50.8 68.3

Navigating the Code

Install

Run pip install -e .

Demo

A demonstration of our method can be run by:

python demo_match.py

This runs our model trained on mega on two images taken from Sacre Coeur.

Benchmarks

See Benchmarks for details.

Training

See Training for details.

Reproducing Results

Given that the required benchmark or training dataset has been downloaded and unpacked, results can be reproduced by running the experiments in the experiments folder.

Using DKM matches for estimation

We recommend using the excellent Graph-Cut RANSAC algorithm: https://github.com/danini/graph-cut-ransac

@5 @10 @20
DKMv3 (RANSAC) 60.5 74.9 85.1
DKMv3 (GC-RANSAC) 65.5 78.0 86.7

Acknowledgements

We have used code and been inspired by https://github.com/PruneTruong/DenseMatching, https://github.com/zju3dv/LoFTR, and https://github.com/GrumpyZhou/patch2pix. We additionally thank the authors of ECO-TR for providing their benchmark.

BibTeX

If you find our models useful, please consider citing our paper!

@inproceedings{edstedt2023dkm,
title={{DKM}: Dense Kernelized Feature Matching for Geometry Estimation},
author={Edstedt, Johan and Athanasiadis, Ioannis and Wadenbäck, Mårten and Felsberg, Michael},
booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
year={2023}
}

Core symbols most depended-on inside this repo

reshape
called by 24
dkm/models/dkm.py
build_scenes
called by 14
dkm/datasets/megadepth.py
cupy_kernel
called by 10
dkm/models/deprecated/local_corr.py
cupy_launch
called by 10
dkm/models/deprecated/local_corr.py
benchmark
called by 10
dkm/benchmarks/scannet_benchmark.py
match
called by 9
dkm/models/dkm.py
train_k_steps
called by 9
dkm/train/train.py
weight_scenes
called by 6
dkm/datasets/megadepth.py

Shape

Method 128
Function 51
Class 43

Languages

Python100%

Modules by API surface

dkm/utils/utils.py44 symbols
dkm/models/dkm.py41 symbols
dkm/models/deprecated/local_corr.py19 symbols
dkm/models/encoders.py16 symbols
dkm/datasets/scannet.py13 symbols
dkm/datasets/megadepth.py12 symbols
dkm/utils/transforms.py7 symbols
dkm/models/deprecated/corr_channels.py7 symbols
dkm/models/deprecated/build_model.py6 symbols
dkm/losses/depth_match_regression_loss.py5 symbols
dkm/benchmarks/deprecated/hpatches_sequences_dense_benchmark.py5 symbols
experiments/dkm/test_DKMv3_outdoor.py4 symbols

For agents

$ claude mcp add DKM \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact