Spaces:
No application file
No application file
Realcat
commited on
Commit
•
b075789
1
Parent(s):
172c865
update:roma and examples
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +1 -0
- common/config.yaml +1 -1
- common/utils.py +27 -2
- datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.2.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.4.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.5.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.6.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.7.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.8.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.9.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.2.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.4.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.5.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.6.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.7.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.8.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.9.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.2.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.4.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.5.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.6.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.7.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.8.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.9.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.2.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.4.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.5.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.6.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.7.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.8.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.9.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.2.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.4.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.5.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.6.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.7.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.8.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.9.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.2.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.4.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.5.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.6.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.7.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.8.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.9.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.2.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.4.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.5.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.6.jpg +3 -0
- datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.7.jpg +3 -0
README.md
CHANGED
@@ -34,6 +34,7 @@ Here is a demo of the tool:
|
|
34 |
![demo](assets/demo.gif)
|
35 |
|
36 |
The tool currently supports various popular image matching algorithms, namely:
|
|
|
37 |
- [x] [OmniGlue](https://github.com/Vincentqyw/omniglue-onnx), CVPR 2024
|
38 |
- [x] [XFeat](https://github.com/verlab/accelerated_features), CVPR 2024
|
39 |
- [x] [RoMa](https://github.com/Vincentqyw/RoMa), CVPR 2024
|
|
|
34 |
![demo](assets/demo.gif)
|
35 |
|
36 |
The tool currently supports various popular image matching algorithms, namely:
|
37 |
+
- [x] [DUSt3R](https://github.com/naver/dust3r), CVPR 2024
|
38 |
- [x] [OmniGlue](https://github.com/Vincentqyw/omniglue-onnx), CVPR 2024
|
39 |
- [x] [XFeat](https://github.com/verlab/accelerated_features), CVPR 2024
|
40 |
- [x] [RoMa](https://github.com/Vincentqyw/RoMa), CVPR 2024
|
common/config.yaml
CHANGED
@@ -29,7 +29,7 @@ matcher_zoo:
|
|
29 |
display: true
|
30 |
DUSt3R:
|
31 |
# TODO: duster is under development
|
32 |
-
enable:
|
33 |
matcher: duster
|
34 |
dense: true
|
35 |
info:
|
|
|
29 |
display: true
|
30 |
DUSt3R:
|
31 |
# TODO: duster is under development
|
32 |
+
enable: true
|
33 |
matcher: duster
|
34 |
dense: true
|
35 |
info:
|
common/utils.py
CHANGED
@@ -232,7 +232,7 @@ def gen_examples():
|
|
232 |
return [pairs[i] for i in selected]
|
233 |
|
234 |
# rotated examples
|
235 |
-
def gen_rot_image_pairs(count: int =
|
236 |
path = ROOT / "datasets/sacre_coeur/mapping"
|
237 |
path_rot = ROOT / "datasets/sacre_coeur/mapping_rot"
|
238 |
rot_list = [45, 180, 90, 225, 270]
|
@@ -253,6 +253,27 @@ def gen_examples():
|
|
253 |
selected = random.sample(range(len(pairs)), count)
|
254 |
return [pairs[i] for i in selected]
|
255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
# extramely hard examples
|
257 |
def gen_image_pairs_wxbs(count: int = None):
|
258 |
prefix = "datasets/wxbs_benchmark/.WxBS/v1.1"
|
@@ -275,6 +296,7 @@ def gen_examples():
|
|
275 |
# image pair path
|
276 |
pairs = gen_images_pairs()
|
277 |
pairs += gen_rot_image_pairs()
|
|
|
278 |
pairs += gen_image_pairs_wxbs()
|
279 |
|
280 |
match_setting_threshold = DEFAULT_SETTING_THRESHOLD
|
@@ -1026,5 +1048,8 @@ def scale_image(input_path, scale_factor, output_path):
|
|
1026 |
width, height = img.size
|
1027 |
new_width = int(width * scale_factor)
|
1028 |
new_height = int(height * scale_factor)
|
|
|
1029 |
img_resized = img.resize((new_width, new_height))
|
1030 |
-
|
|
|
|
|
|
232 |
return [pairs[i] for i in selected]
|
233 |
|
234 |
# rotated examples
|
235 |
+
def gen_rot_image_pairs(count: int = 5):
|
236 |
path = ROOT / "datasets/sacre_coeur/mapping"
|
237 |
path_rot = ROOT / "datasets/sacre_coeur/mapping_rot"
|
238 |
rot_list = [45, 180, 90, 225, 270]
|
|
|
253 |
selected = random.sample(range(len(pairs)), count)
|
254 |
return [pairs[i] for i in selected]
|
255 |
|
256 |
+
def gen_scale_image_pairs(count: int = 5):
|
257 |
+
path = ROOT / "datasets/sacre_coeur/mapping"
|
258 |
+
path_scale = ROOT / "datasets/sacre_coeur/mapping_scale"
|
259 |
+
scale_list = [0.3, 0.5]
|
260 |
+
pairs = []
|
261 |
+
for file in os.listdir(path):
|
262 |
+
if file.lower().endswith((".jpg", ".jpeg", ".png")):
|
263 |
+
for scale in scale_list:
|
264 |
+
file_scale = "{}_scale{}.jpg".format(Path(file).stem, scale)
|
265 |
+
if (path_scale / file_scale).exists():
|
266 |
+
pairs.append(
|
267 |
+
[
|
268 |
+
path / file,
|
269 |
+
path_scale / file_scale,
|
270 |
+
]
|
271 |
+
)
|
272 |
+
if len(pairs) < count:
|
273 |
+
count = len(pairs)
|
274 |
+
selected = random.sample(range(len(pairs)), count)
|
275 |
+
return [pairs[i] for i in selected]
|
276 |
+
|
277 |
# extramely hard examples
|
278 |
def gen_image_pairs_wxbs(count: int = None):
|
279 |
prefix = "datasets/wxbs_benchmark/.WxBS/v1.1"
|
|
|
296 |
# image pair path
|
297 |
pairs = gen_images_pairs()
|
298 |
pairs += gen_rot_image_pairs()
|
299 |
+
pairs += gen_scale_image_pairs()
|
300 |
pairs += gen_image_pairs_wxbs()
|
301 |
|
302 |
match_setting_threshold = DEFAULT_SETTING_THRESHOLD
|
|
|
1048 |
width, height = img.size
|
1049 |
new_width = int(width * scale_factor)
|
1050 |
new_height = int(height * scale_factor)
|
1051 |
+
new_img = Image.new("RGB", (width, height), (0, 0, 0))
|
1052 |
img_resized = img.resize((new_width, new_height))
|
1053 |
+
position = ((width - new_width) // 2, (height - new_height) // 2)
|
1054 |
+
new_img.paste(img_resized, position)
|
1055 |
+
new_img.save(output_path)
|
datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.2.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.4.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.5.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.6.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.7.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.8.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/02928139_3448003521_scale0.9.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.2.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.4.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.5.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.6.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.7.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.8.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/03903474_1471484089_scale0.9.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.2.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.4.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.5.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.6.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.7.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.8.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/10265353_3838484249_scale0.9.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.2.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.4.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.5.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.6.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.7.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.8.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/17295357_9106075285_scale0.9.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.2.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.4.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.5.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.6.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.7.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.8.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/32809961_8274055477_scale0.9.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.2.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.4.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.5.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.6.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.7.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.8.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/44120379_8371960244_scale0.9.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.2.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.4.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.5.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.6.jpg
ADDED
Git LFS Details
|
datasets/sacre_coeur/mapping_scale/51091044_3486849416_scale0.7.jpg
ADDED
Git LFS Details
|