Vincentqyw / image-matching-webui

🤗 image matching toolbox webui
https://huggingface.co/spaces/Realcat/image-matching-webui
Apache License 2.0
716 stars 59 forks source link

KeyError: 'weights' while using sfd2+imp #59

Closed eyildiz-ugoe closed 1 month ago

eyildiz-ugoe commented 1 month ago

🐛 Bug Report

[2024/08/20 16:30:50 hloc INFO] Testing sfd2+imp ...
Traceback (most recent call last):
  File "/home/username/image-matching-webui/test_app_cli.py", line 124, in <module>
    test_all(config)
  File "/home/username/image-matching-webui/test_app_cli.py", line 29, in test_all
    api = ImageMatchingAPI(conf=v, device=DEVICE)
  File "/home/username/image-matching-webui/ui/api.py", line 63, in __init__
    self._init_models()
  File "/home/username/image-matching-webui/ui/api.py", line 121, in _init_models
    self.matcher = get_model(self.match_conf)
  File "/home/username/image-matching-webui/ui/utils.py", line 175, in get_model
    model = Model(match_conf["model"]).eval().to(DEVICE)
  File "/home/username/image-matching-webui/hloc/utils/base_model.py", line 17, in __init__
    self._init(conf)
  File "/home/username/image-matching-webui/hloc/matchers/imp.py", line 37, in _init
    self.net = GIM(self.conf).eval().to(DEVICE)
  File "/home/username/image-matching-webui/hloc/utils/base_model.py", line 17, in __init__
    self._init(conf)
  File "/home/username/image-matching-webui/hloc/matchers/gim.py", line 35, in _init
    conf["model_name"] = str(conf["weights"])
KeyError: 'weights'

🔬 How To Reproduce

Enable all methods in the config file and run python test_app_cli.py

Environment

Vincentqyw commented 1 month ago

Yes, these are known bugs, so some algorithms are temporarily disabled in the config file. There are conflicts in importing packages. I will fix it in the future. By the way, if you have already found a solution, please submit a PR. Another known bug: https://github.com/Vincentqyw/image-matching-webui/issues/57

eyildiz-ugoe commented 1 month ago

So I tried all combinations in the config file, and so far I was able to get all running except for these:

###############THESE WONT WORK FOR NOW#####################
  gluestick:
    enable: false
    matcher: gluestick
    dense: true
    info:
      name: GlueStick #dispaly name
      source: "ICCV 2023"
      github: https://github.com/cvg/GlueStick
      paper: https://arxiv.org/abs/2304.02008
      project: https://iago-suarez.com/gluestick
      display: true
  sold2:
    enable: false
    matcher: sold2
    dense: true
    info:
      name: SOLD2 #dispaly name
      source: "CVPR 2021"
      github: https://github.com/cvg/SOLD2
      paper: https://arxiv.org/abs/2104.03362
      project: null
      display: true
  sfd2+imp:
    enable: false
    skip_ci: true
    matcher: imp
    feature: sfd2
    dense: false
    info:
      name: SFD2+IMP #dispaly name
      source: "CVPR 2023"
      github: https://github.com/feixue94/imp-release
      paper: https://arxiv.org/pdf/2304.14837
      project: https://feixue94.github.io/
      display: true
#########################################################

These threw some error regarding visualization, and I couldn't fix it as I had to delve deeper. Perhaps I can share those bugs too as separate issues.

Vincentqyw commented 1 month ago

Fixed sfd2+imp: https://github.com/Vincentqyw/image-matching-webui/pull/63