Vincentqyw / image-matching-webui

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

Wrong import file name in GIM/r2d2 #57

Closed eyildiz-ugoe closed 3 months ago

eyildiz-ugoe commented 3 months ago

🐛 Bug Report

There is some weird import error in the structure. While it is trying to do r2d2 stuff, it throws error about another method called gim.

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 126, in _init_models
    self.extractor = get_feature_model(self.conf["feature"])
  File "/home/username/image-matching-webui/ui/utils.py", line 189, in get_feature_model
    Model = dynamic_load(extractors, conf["model"]["name"])
  File "/home/username/image-matching-webui/hloc/utils/base_model.py", line 39, in dynamic_load
    module = __import__(module_path, fromlist=[""])
  File "/home/username/image-matching-webui/hloc/extractors/r2d2.py", line 12, in <module>
    from extract import NonMaxSuppression, extract_multiscale, load_network
  File "/home/username/image-matching-webui/hloc/extractors/../../third_party/r2d2/extract.py", line 11, in <module>
    from tools import common
ImportError: cannot import name 'common' from 'tools' (/home/username/image-matching-webui/hloc/matchers/../../third_party/gim/tools/__init__.py)

🔬 How To Reproduce

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

Environment

eyildiz-ugoe commented 3 months ago

I think it must be something like this in extract.py:

from third_party.r2d2.tools import common

Vincentqyw commented 3 months ago

Fixed: https://github.com/Vincentqyw/image-matching-webui/pull/63. Please retry, and if there are no errors, kindly close the issue.