-
Notifications
You must be signed in to change notification settings - Fork 56
Add MatchAnything matcher (ELoFTR/RoMa) and docs #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add MatchAnything matcher (ELoFTR/RoMa) and docs #49
Conversation
alexstoken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Looks really good. I have a few requested changes (see comments).
Let me know if you want help with the changes, happy to pitch in.
It will be great to have MatchAnything included in IMM.
| Download checkpoints (kept out of git) into the nested MatchAnything folder. PowerShell example: | ||
| ```powershell | ||
| cd matching/third_party/MatchAnything/imcui/third_party/MatchAnything | ||
| python -m pip install gdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gdown is dependency already, so we can move this code to the download_weights() fn so that they are auto downloaded at first install. See example here.
| cd matching/third_party/MatchAnything/imcui/third_party/MatchAnything | ||
| python -m pip install gdown | ||
| python -m gdown 12L3g9-w8rR9K2L4rYaGaDJ7NqX1D713d --fuzzy -O weights.zip | ||
| tar -xf weights.zip # or: unzip weights.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unzipping and removing the zip should also be done in download_weights
| Weights should be at `matching/third_party/MatchAnything/imcui/third_party/MatchAnything/weights/matchanything_eloftr.ckpt` and `matching/third_party/MatchAnything/imcui/third_party/MatchAnything/weights/matchanything_roma.ckpt`. | ||
| The RoMa variant uses the vendored ROMA package (inside the submodule); if your env cannot import `roma`, install it in editable mode: | ||
| ```bash | ||
| python -m pip install -e matching/third_party/MatchAnything/imcui/third_party/MatchAnything/third_party/ROMA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this work if you directly install romatch from pypi? see here
| return padded, mask | ||
|
|
||
|
|
||
| def dict_to_device(data_dict, device="cuda"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be moved to utils
| return data_dict_device | ||
|
|
||
|
|
||
| def list_to_device(data_list, device="cuda"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be moved to utils
| return mkpts0, mkpts1, None, None, None, None | ||
|
|
||
|
|
||
| def resize(img, resize=None, df=8, padding=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy to keep this and the other resize components if we need them, but are they significantly different from the resize already supported in load_image and resize_by and resize_to_divisible ?
Summary
register names
MatchAnything
Lightning 1.4.9 compatibility pins in README
Lightning 1.4.9
Testing
cuda --im_size 832 --out_dir outputs_matchanything-eloftr
--im_size 832 --out_dir outputs_matchanything-roma