loftr
Native Rust/tch LoFTR feature matching.
What This Crate Includes
- LoFTR config presets
- native model construction in Rust with
tch - loading Kornia-compatible state dict weights
- pairwise feature matching
- optional debug-stage dumps for validation
Public API
LoftrConfigfor preset and custom model configurationLoftrModelfor model construction, weight loading, and inferenceLoftrMatchesfor match outputsLoftrDebugStagesfor validation-oriented stage summariesnormalize_loftr_imagefor converting supported image layouts into LoFTR input tensorsLoftrErrorfor public error handling
Upstream References
Weights
This crate does not ship pretrained weights.
Generate them locally from the workspace root:
Then load them from:
artifacts/weights/loftr_outdoor_state_dict.safetensors
Example
use ;
use ;
let mut model = new?;
model.load_weights?;
let image0 = rand;
let image1 = rand;
let matches = model.forward?;
println!;
# Ok::
Docs.rs
The published API docs are built with the doc-only feature so docs.rs can
render the crate without linking libtorch.