DeDoDe v2
DeDoDe v2 (Chalmers, Linköping University; 3DV 2024): sparse keypoints from a detector network, descriptions from a separate one (VGG19, plus DINOv2 for -G), dual-softmax matches as keypoint index pairs (the form COLMAP takes). MIT; DINOv2 Apache-2.0.
experimental Fork of Parskatt/DeDoDe@6d15618 · backends: portable, kernels
- Paper DeDoDe v2: Analyzing and Improving the DeDoDe Keypoint Detector CVPR Workshops 2024 · first released 13 Apr 2024
Paper 2024 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import matching
model = matching.load("dedode-v2-b") # kernels on a supported GPU, else portable PyTorch
result = model(image_a, image_b)
result.keypoints1 # also: keypoints2, pairs, scores
result.backend # what ran: mode, device, dtype, kernels
points1, points2 = result.matches(5000) # matched pixels, sampled where the model is certain
pose = matching.estimate_pose(points1, points2, K1, K2) # relative pose on the GPU (RANSAC); K = intrinsics [3, 3]
pose.R, pose.t, pose.inliers # rotation, unit translation, inlier mask fastforks bench dedode-v2-b Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 768x1024 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | not measured | – | – | – | – |
| Original fp16the authors' mixed-precision option (float16); upstream DeDoDe-L v2 + descriptor B, 10000 keypoints | fp16 | 318 | – | 1,734 MiB/1,992 MiB | 2.6 | 1.54 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 246 | 1.3× | 1,535 MiB/1,654 MiB | 0.7 | 0.75 |
| Kernels | fp16 | 189 | 1.7× | 1,197 MiB/1,246 MiB | 0.6 | 0.84 |
| Portable + torch.compile | 164 | 1.9× | 1,893 MiB/2,434 MiB | 50 (build) | – | |
| TensorRTplanned for 0.2.1 | fails | – | – | – | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-13 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-17 | Original | fp32 | 1711 | 8,024 MiB process | – | 768x1024 |
| Portable | fp32 | 1464 | 8,011 MiB process | matches | 768x1024 | |
| Kernels | fp16 | not implemented | – | 768x1024 | ||
| Kernels | fp32 | not implemented | – | 768x1024 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
- Code
- MIT LICENSELICENSE-DINOv2
- Weights
- MIT source
- Training data
Our reading of the licences, not legal advice.
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
MegaDepth-1500
every 10th pair, relative pose AUC@5 / @10 / @20 degrees
| Run | dtype | AUC@5° ↑ | AUC@10° ↑ | AUC@20° ↑ | pairs | ms / pair |
|---|---|---|---|---|---|---|
| Original fp32 | not measured | |||||
| Original fp16 | fp16 | 57.3 | 71.5 | 82.5 | 150 | 318 |
| Portable fp32 | fp32 | 56.0 | 72.0 | 82.7 | 150 | 465 |
| Portable | fp16 | 54.6 | 71.8 | 83.1 | 150 | 246 |
| Kernels | fp16 | 57.8 | 74.3 | 84.2 | 150 | 189 |
The original code was not run on this dataset, so the table cannot show the distance to it.
Dense matchers: 5000 matches per pair sampled from the warp by certainty (upstream's balanced KDE sampling); sparse matchers: all their matches of one call (LightGlue, XFeat: LightGlue's MegaDepth-1500 setting; LoFTR, DeDoDe: their card defaults). OpenCV essential-matrix RANSAC (0.5 px threshold, normalised by the mean focal length); AUC of the larger of the rotation and translation-direction errors. Original = the authors’ code, same checkpoint and protocol. Measured on original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks d073b335, 2026-11-18; portable: RTX 5060 Ti, torch 2.14.1+cu130, fastforks aee4b565, 2026-11-13; kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 68b2f345, 2026-11-16.
Relative pose on the GPU
A dense matcher is usually followed by RANSAC on its matches to get the camera motion. fastforks does that step on the
GPU too: result.matches(n) samples matched points where the model is certain, and matching.estimate_pose runs essential-matrix RANSAC on them, many image pairs per call, with no copy to
the CPU. Like the models it has a portable (plain PyTorch) and a kernels (CUDA) backend.
| Solver | Runs on | Threshold (px) | Pose AUC@5 / @10 / @20 | Pairs per second |
|---|---|---|---|---|
| fastforks estimate_pose, kernels | GPU, batches of 500 pairs | 1.0 | 69.9 / 81.5 / 89.3 | 18,446 |
| fastforks estimate_pose, portable | GPU, batches of 500 pairs | 1.0 | 69.6 / 81.2 / 89.1 | 418 |
| PoseLib 2.0.5 | CPU, 16 processes | 1.0 | 70.0 / 81.6 / 89.5 | 325 |
| OpenCV USAC (MAGSAC++) | CPU, 16 processes | 0.5 | 65.7 / 78.6 / 87.3 | 271 |
| OpenCV RANSAC | CPU, 16 processes | 0.5 | 62.9 / 76.9 / 86.4 | 323 |
MegaDepth-1500, RoMa v2 matches (5000 per pair), 5 samplings, the same matches for every solver, on one machine: RTX 5060 Ti and a Ryzen 7 5800X (16 threads). Each solver runs at the inlier threshold where it is most accurate. Pairs per second is wall-clock throughput over all 7500 poses: the CPU solvers run one pair per call in 16 single-threaded processes, the GPU solver takes 500 pairs per call. One pair alone takes about 1.7 ms with the kernels, 29 ms with PoseLib and 24 ms with OpenCV RANSAC on one core. The accuracy table above stays on OpenCV RANSAC, as in the papers, so it is comparable with published numbers; this table is the only place the GPU solver is used.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.011 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.002 and p99 <= 0.001 (absolute error of the output keypoints1).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.011 | not recorded |
| cpu_min_recall | ≤ 0.99 | not recorded |
| cpu_min_match | ≤ 0.99 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.002 | 0.002 |
| GPU default dtypes, p99 |diff| | ≤ 0.001 | 0 |
| gpu_min_recall | ≤ 0.9986 | not recorded |
| gpu_min_match | ≤ 0.986 | not recorded |
| gpu_mean_kernels | ≤ 0.003 | not recorded |
| gpu_min_match_kernels | ≤ 0.98 | not recorded |
Recorded for dedode-v2-b on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-15, with these kernels: cudnn_hacccutlass_convigev
Details
DeDoDe v2 (Edstedt et al., 3DV 2024; detector v2: CVPR Workshops 2024): detect, don't describe, describe, don't detect. A VGG19 network with convolutional refiners finds 10000 keypoints per image (the detector, retrained in v2), a separate descriptor network (VGG19, or VGG19 + a frozen DINOv2 ViT-L/14 for -G) describes them, and the descriptions are matched as mutual maxima of a dual softmax. Returns both keypoint sets, the index pairs of the matches and their probability.
- Input / output
- Input: two RGB images of one scene. Output: for every pixel of the first image its position in the second (x, y in pixels) and a certainty that the pixel is visible in both.
What the numbers mean, and which models need the camera focal length
Sparse matchers (LightGlue) return the keypoints of both images and the index pairs of the matched ones instead. To reconstruct camera poses from an image folder with these matchers, see [structure from motion](../sfm.md).
- Input size
- any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (1,983 MiB allocated)
- Options
size=784>= 56· changes the outputmax_keypoints=10000>= 1· changes the output
- Outputs
keypoints1,keypoints2,pairs,scores- Checkpoint
descriptor="B"- CUDA kernels
igevIGEV stereo: convolution epilogues, correlation lookups, GRU gatescutlass_convCUTLASS convolutions with the recurrent update (GRU) fused incudnn_haccconvolutions with fp16 accumulation (cuDNN)
- Apple (MPS)
- fp32
Limitations
- Sparse output: no dense warp. `result.matches()` gives the matched points for `estimate_pose`; `pairs` are the index pairs pycolmap / COLMAP databases take.
- One image pair per call internally (batches run pair by pair); the match counts differ per pair.
- No exportable module: the match counts are data-dependent (`torch.compile` runs with graph breaks; ONNX / TensorRT export fails).
- Images are resized to a `size` x `size` square (default 784, as upstream) whatever their aspect ratio; the dual softmax holds a `max_keypoints`^2 matrix (10000 keypoints: 400 MB per float32 copy).
- Upright only: the released descriptors are not trained for in-plane rotations.
Full reference, generated from the repository
DeDoDe v2 (Chalmers, Linköping University; 3DV 2024): sparse keypoints from a detector network, descriptions from a separate one (VGG19, plus DINOv2 for -G), dual-softmax matches as keypoint index pairs (the form COLMAP takes). MIT; DINOv2 Apache-2.0.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
dedode-v2-b | synthetic (768x1024) | original portable kernels portable + torch.compile TensorRT fp16 | 318 246 189 164 planned for 0.2.1 | 1734 / 1992 1535 / 1654 1197 / 1246 1893 / 2434 – |
dedode-v2-g | synthetic (768x1024) | original portable kernels portable + torch.compile TensorRT fp16 | 666 592 332 330 planned for 0.2.1 | 2335 / 2472 2142 / 2334 1787 / 1984 2881 / 3316 – |
Details
- Original code: https://github.com/Parskatt/DeDoDe at
6d156183f4dc - Code licence: MIT (permissive); files:
LICENSE,LICENSE-DINOv2 - Weights licence: MIT
- Licence evidence: https://github.com/Parskatt/DeDoDe/blob/6d156183f4dc84cd704ae779eebc8350995c5b06/README.md#license ; https://github.com/Parskatt/DeDoDe/blob/6d156183f4dc84cd704ae779eebc8350995c5b06/LICENSE
- Training data: MegaDepth (Internet photo collections with SfM / MVS depth) (Detector v2 and descriptors: MegaDepth (README training section, papers); DINOv2 (-G, frozen): LVD-142M (Meta).)
- Options:
size= 784 (>= 56),max_keypoints= 10000 (>= 1) - Kernel libraries:
igev,cutlass_conv,cudnn_hacc - Variants:
dedode-v2-b,dedode-v2-g - Not in this release (planned for 0.2.1):
dedode-v2-bTensorRT export: TensorRT TopK supports K <= 3840; the keypoint top-k is larger;dedode-v2-gTensorRT export: TensorRT TopK supports K <= 3840; the keypoint top-k is larger - Outputs: keypoints1, keypoints2, pairs, scores
- Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
dedode-v2-b3000x4000 (1.9 GiB peak allocated, 3.8 reserved);dedode-v2-g3000x4000 (2.5 GiB peak allocated, 4.5 reserved) dedode-v2-b768x1024, first call: portable + torch.compile 50 s (cold Inductor cache).dedode-v2-g768x1024, first call: portable + torch.compile 86 s (cold Inductor cache).dedode-v2-boriginal 768x1024: the authors' mixed-precision option (float16); upstream DeDoDe-L v2 + descriptor B, 10000 keypointsdedode-v2-goriginal 768x1024: the authors' mixed-precision option (float16); upstream DeDoDe-L v2 + descriptor G, 10000 keypointsdedode-v2-bload / first call: original 3.73 s / 1.099 s, portable 0.67 s / 0.753 s, kernels 0.55 s / 0.84 sdedode-v2-gload / first call: original 6.36 s / 1.509 s, portable 1.12 s / 1.038 s, kernels 3.01 s / 0.675 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
Dense matchers: 5000 matches per pair sampled from the warp by certainty (upstream's balanced KDE sampling); sparse matchers: all their matches of one call (LightGlue, XFeat: LightGlue's MegaDepth-1500 setting; LoFTR, DeDoDe: their card defaults). OpenCV essential-matrix RANSAC (0.5 px threshold, normalised by the mean focal length); AUC of the larger of the rotation and translation-direction errors. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|
dedode-v2-b | MegaDepth-1500, every 10th pair, relative pose AUC@5 / @10 / @20 degrees | 57.3 / 71.5 / 82.5 | 54.6 / 71.8 / 83.1 | 56.0 / 72.0 / 82.7 | 57.8 / 74.3 / 84.2 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks aee4b565, 2026-11-13; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks d073b335, 2026-11-18; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 68b2f345, 2026-11-16.
Parity
CPU, float32: max |diff| <= 0.011 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.002 and p99 <= 0.001 (absolute error of the output keypoints1).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
dedode-v2-b | 0.002 / 0.0 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120 |
dedode-v2-g | 0.002 / 0.0 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120 |
Limitations
- Sparse output: no dense warp.
result.matches()gives the matched points forestimate_pose;pairsare the index pairs pycolmap / COLMAP databases take. - One image pair per call internally (batches run pair by pair); the match counts differ per pair.
- No exportable module: the match counts are data-dependent (
torch.compileruns with graph breaks; ONNX / TensorRT export fails). - Images are resized to a
sizexsizesquare (default 784, as upstream) whatever their aspect ratio; the dual softmax holds amax_keypoints^2 matrix (10000 keypoints: 400 MB per float32 copy). - Upright only: the released descriptors are not trained for in-plane rotations.
Example output
No example rendered for this checkpoint yet.