Realcat commited on
Commit
d09096d
·
1 Parent(s): 1eae534

update: gim roma

Browse files
README.md CHANGED
@@ -217,4 +217,4 @@ This code is built based on [Hierarchical-Localization](https://github.com/cvg/H
217
  [stars-shield]: https://img.shields.io/github/stars/Vincentqyw/image-matching-webui.svg?style=for-the-badge
218
  [stars-url]: https://github.com/Vincentqyw/image-matching-webui/stargazers
219
  [issues-shield]: https://img.shields.io/github/issues/Vincentqyw/image-matching-webui.svg?style=for-the-badge
220
- [issues-url]: https://github.com/Vincentqyw/image-matching-webui/issues
 
217
  [stars-shield]: https://img.shields.io/github/stars/Vincentqyw/image-matching-webui.svg?style=for-the-badge
218
  [stars-url]: https://github.com/Vincentqyw/image-matching-webui/stargazers
219
  [issues-shield]: https://img.shields.io/github/issues/Vincentqyw/image-matching-webui.svg?style=for-the-badge
220
+ [issues-url]: https://github.com/Vincentqyw/image-matching-webui/issues
config/config.yaml CHANGED
@@ -112,9 +112,21 @@ matcher_zoo:
112
  paper: https://arxiv.org/abs/2312.14132
113
  project: https://dust3r.europe.naverlabs.com
114
  display: true
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  GIM(dkm):
116
  enable: true
117
- # skip_ci: true
118
  matcher: gim(dkm)
119
  dense: true
120
  info:
 
112
  paper: https://arxiv.org/abs/2312.14132
113
  project: https://dust3r.europe.naverlabs.com
114
  display: true
115
+ GIM(RoMa):
116
+ matcher: gim_roma
117
+ skip_ci: true
118
+ dense: true
119
+ enable: true
120
+ info:
121
+ name: GIM(RoMa) #dispaly name
122
+ source: "ICLR 2024"
123
+ github: https://github.com/xuelunshen/gim
124
+ paper: https://arxiv.org/abs/2402.11095
125
+ project: https://xuelunshen.com/gim
126
+ display: true
127
+ efficiency: low # low, medium, high
128
  GIM(dkm):
129
  enable: true
 
130
  matcher: gim(dkm)
131
  dense: true
132
  info:
imcui/hloc/match_dense.py CHANGED
@@ -337,6 +337,23 @@ confs = {
337
  "dfactor": 8,
338
  },
339
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  "rdd_dense": {
341
  "output": "matches-rdd_dense",
342
  "model": {
 
337
  "dfactor": 8,
338
  },
339
  },
340
+ "gim_roma": {
341
+ "output": "matches-gim_roma",
342
+ "model": {
343
+ "name": "roma",
344
+ "model_name": "gim_roma_100h.ckpt",
345
+ "max_keypoints": 2000,
346
+ "match_threshold": 0.2,
347
+ },
348
+ "preprocessing": {
349
+ "grayscale": False,
350
+ "force_resize": True,
351
+ "resize_max": 1024,
352
+ "width": 320,
353
+ "height": 240,
354
+ "dfactor": 8,
355
+ },
356
+ },
357
  "rdd_dense": {
358
  "output": "matches-rdd_dense",
359
  "model": {
imcui/hloc/matchers/roma.py CHANGED
@@ -43,6 +43,14 @@ class Roma(BaseModel):
43
  logger.info("Loading Roma model")
44
  # load the model
45
  weights = torch.load(model_path, map_location="cpu")
 
 
 
 
 
 
 
 
46
  dinov2_weights = torch.load(dinov2_weights, map_location="cpu")
47
 
48
  if str(device) == "cpu":
 
43
  logger.info("Loading Roma model")
44
  # load the model
45
  weights = torch.load(model_path, map_location="cpu")
46
+
47
+ if self.conf["model_name"] == "gim_roma_100h.ckpt":
48
+ if "state_dict" in weights.keys():
49
+ weights = weights["state_dict"]
50
+ for k in list(weights.keys()):
51
+ if k.startswith("model."):
52
+ weights[k.replace("model.", "", 1)] = weights.pop(k)
53
+
54
  dinov2_weights = torch.load(dinov2_weights, map_location="cpu")
55
 
56
  if str(device) == "cpu":