Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,4 +8,21 @@ pinned: false
|
|
| 8 |
short_description: A unified API wrapping 37+ image matching models
|
| 9 |
---
|
| 10 |
|
| 11 |
-
Welcome to [Image Matching Models (IMM](https://github.com/alexstoken/image-matching-models). IMM is a unified interface that wraps 37+ image matching models, making it easy to apply the models to a downstream task or eval with minimal boilerplate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
short_description: A unified API wrapping 37+ image matching models
|
| 9 |
---
|
| 10 |
|
| 11 |
+
Welcome to [Image Matching Models (IMM)](https://github.com/alexstoken/image-matching-models). IMM is a unified interface that wraps 37+ image matching models, making it easy to apply the models to a downstream task or eval with minimal boilerplate. We provide a simple API for deploying keypoint, semi dense, and dense image matching models on image pairs.
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
```
|
| 15 |
+
from matching import get_matcher
|
| 16 |
+
from matching.viz import plot_matches
|
| 17 |
+
|
| 18 |
+
device = 'cuda' # 'cpu'
|
| 19 |
+
matcher = get_matcher('my-fav-matcher', device=device) # Choose any of our ~37+ matchers listed below
|
| 20 |
+
img_size = 512 # optional
|
| 21 |
+
|
| 22 |
+
img0 = matcher.load_image('assets/example_pairs/outdoor/montmartre_close.jpg', resize=img_size)
|
| 23 |
+
img1 = matcher.load_image('assets/example_pairs/outdoor/montmartre_far.jpg', resize=img_size)
|
| 24 |
+
|
| 25 |
+
result = matcher(img0, img1)
|
| 26 |
+
# result.keys() = ['num_inliers', 'H', 'all_kpts0', 'all_kpts1', 'all_desc0', 'all_desc1', 'matched_kpts0', 'matched_kpts1', 'inlier_kpts0', 'inlier_kpts1']
|
| 27 |
+
plot_matches(img0, img1, result, save_path='plot_matches.png')
|
| 28 |
+
```
|