Metadata-Version: 2.5
Name: efficientloftr-inference
Version: 0.1.1
Summary: Unofficial pip-installable packaging of the EfficientLoFTR matcher (zju3dv), inference path only
Project-URL: Upstream, https://github.com/zju3dv/EfficientLoFTR
Project-URL: Paper, https://zju3dv.github.io/efficientloftr/
License-Expression: Apache-2.0
License-File: CHANGES.md
License-File: LICENSE
License-File: NOTICE
Keywords: EfficientLoFTR,LoFTR,computer vision,feature matching,image matching
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: >=3.10
Requires-Dist: einops
Requires-Dist: kornia>=0.7
Requires-Dist: numpy
Requires-Dist: torch>=2.0
Description-Content-Type: text/markdown

# efficientloftr-inference

Unofficial, pip-installable packaging of the **inference path** of
[EfficientLoFTR](https://github.com/zju3dv/EfficientLoFTR) (Wang, He, Peng, Tan, Zhou; CVPR 2024),
the semi-dense local feature matcher. It exists because upstream ships no packaging metadata, so
the official code cannot be installed from PyPI or a git URL.

This package is **not** affiliated with or endorsed by the EfficientLoFTR authors. The name
identifies the origin of the code only.

## What is inside

- `src/loftr` and `src/utils/misc.py` of upstream commit `ffd4a464`, unchanged except for the
  edits listed in `CHANGES.md` (drop `loguru`, `yacs` and `pytorch_lightning` from the inference path).
- No training code, no datasets, **no pretrained weights**. Download the official checkpoint from
  the upstream README and load its `state_dict`.

## Usage

```python
import torch
from efficientloftr_inference import LoFTR, full_config

net = LoFTR(config=full_config(coarse_threshold=0.2))
net.load_state_dict(torch.load("eloftr_outdoor.ckpt", map_location="cpu")["state_dict"])
net.eval()

# grayscale float tensors in [0, 1], shape (1, 1, H, W), H and W multiples of 32
batch = {"image0": img0, "image1": img1}
with torch.inference_mode():
    net(batch)
kpts0, kpts1, conf = batch["mkpts0_f"], batch["mkpts1_f"], batch["mconf"]
```

## Licence and attribution

Apache License 2.0, the licence under which the upstream authors published the packaged commit.
See `NOTICE` for attribution and for the upstream repository's later change of licence, and
`CHANGES.md` for every modification. `verify_upstream.py` downloads the upstream archive at the
packaged commit and diffs it against these sources.

If you use this in research, cite the authors:

```bibtex
@inproceedings{wang2024eloftr,
  title     = {Efficient LoFTR: Semi-Dense Local Feature Matching with Sparse-Like Speed},
  author    = {Wang, Yifan and He, Xingyi and Peng, Sida and Tan, Dongli and Zhou, Xiaowei},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year      = {2024}
}
```
