Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Code for "LoFTR: Detector-Free Local Feature Matching with Transformers", CVPR 2021, T-PAMI 2022
| Date | Stars |
|---|---|
| 2026-07-24 | 2933 |
| 2026-07-25 | 2933 |
| 2026-07-28 | 2933 |
| 2026-07-30 | 2933 |
| 2026-08-06 | 2933 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# LoFTR: Detector-Free Local Feature Matching with Transformers
### [Project Page](https://zju3dv.github.io/loftr) | [Paper](https://arxiv.org/pdf/2104.00680.pdf)
<br/>
> LoFTR: Detector-Free Local Feature Matching with Transformers
> [Jiaming Sun](https://jiamingsun.ml)<sup>\*</sup>, [Zehong Shen](https://zehongs.github.io/)<sup>\*</sup>, [Yu'ang Wang](https://github.com/angshine)<sup>\*</sup>, [Hujun Bao](http://www.cad.zju.edu.cn/home/bao/), [Xiaowei Zhou](http://www.cad.zju.edu.cn/home/xzhou/)
> CVPR 2021

## TODO List and ETA
- [x] Inference code and pretrained models (DS and OT) (2021-4-7)
- [x] Code for reproducing the test-set results (2021-4-7)
- [x] Webcam demo to reproduce the result shown in the GIF above (2021-4-13)
- [x] Training code and training data preparation (expected 2021-6-10)
Discussions about the paper are welcomed in the [discussion panel](https://github.com/zju3dv/LoFTR/discussions).
:thinking: **FAQ**
1. Undistorted images from D2Net are not available anymore.
For a temporal alternative, please use the undistorted images provided by the MegaDepth_v1 (should be downloaded along with the required depth files). We numerically compared these images and only found very subtle difference.
:triangular_flag_on_post: **Updates**
- Check out [QuadTreeAttention](https://github.com/Tangshitao/QuadTreeAttention), a new attention machanism that improves the efficiency and performance of LoFTR with less demanding GPU requirements for training.
- :white_check_mark: Integrated to [Huggingface Spaces](https://huggingface.co/spaces) with [Gradio](https://github.com/gradio-app/gradio). See [Gradio Web Demo](https://huggingface.co/spaces/akhaliq/Kornia-LoFTR)
## Colab demo
Want to run LoFTR with custom image pairs without configuring your own GPU environment? Try the Colab demo:
[](https://colab.research.google.com/drive/1BgNIOjFHauFoNB95LGesHBIjioX74USW?usp=sharing)
## Using from kornia
LoFTR is integrated into [kornia](https://github.com/kornia/kornia) library since version 0.5.11.
```
pip install kornia
```
Then you can import it as
```python3
from kornia.feature import LoFTR
```
See tutorial on using LoFTR from kornia [here](https://kornia-tutorials.readthedocs.io/en/latest/image_matching.html).
## Installation
```shell
# For full pytorch-lightning trainer features (recommended)
conda env create -f environment.yaml
conda activate loftr
# For the LoFTR matcher only
pip install torch einops yacs kornia
```
We provide the [download link](https://drive.google.com/drive/folders/1DOcOPZb3-5cWxLqn256AhwUVjBPifhuf?usp=sharing) to
- the scannet-1500-testset (~1GB).
- the megadepth-1500-testset (~600MB).
- 4 pretrained models of indoor-ds, indoor-ot, outdoor-ds and outdoor-ot (each ~45MB).
By now, the environment is all set and the LoFTR-DS model is ready to go!
If you want to run LoFTR-OT, some extra steps are needed:
<details>
<summary>[Requirements for LoFTR-OT]</summary>
We use the code from [SuperGluePretrainedNetwork](https://github.com/magicleap/SuperGluePretrainedNetwork) for optimal transport. However, we can't provide the code directly due its strict LICENSE requirements. We recommend downloading it with the following command instead.
```shell
cd src/loftr/utils
wget https://raw.githubusercontent.com/magicleap/SuperGluePretrainedNetwork/master/models/superglue.py
```
</details>
## Run LoFTR demos
### Match image pairs with LoFTR
<details>
<summary>[code snippets]</summary>
```python
from src.loftr import LoFTR, default_cfg
# Initialize LoFTR
matcher = LoFTR(config=default_cfg)
matcher.load_state_dict(torch.load("weights/indoor_ds.ckpt")['state_dict'])
matcher = matcher.eval().cuda()
# Inference
with torch.no_grad():
matcher(batch) # batch = {'image0': img0, 'image1': img1}
mkpts0 = batch['mkpts0_f'].cpu().numpy(Excerpt of 8,532 characters
Read on GitHubJiaming Sun · 4DV.ai & ZJU-3DV · China
17
YuAng
12
7
Ahsen Khaliq · Huggingface
1
Dmytro Mishkin · Czech Technical University in Prague · Czech Republic
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:dfebb7ff9ea538b4, topic:pose-estimation