Skip to content

Conversation

@aliejabbari
Copy link

Summary

  • add MatchAnything matcher wrapper (ELoFTR and RoMa variants) and
    register names
  • vendor MatchAnything code + weights under matching/third_party/
    MatchAnything
  • document usage, weight locations, ROMA editable install, and
    Lightning 1.4.9 compatibility pins in README
  • pin torchmetrics 0.6.0, wandb 0.15.12, pydantic 1.10.x for
    Lightning 1.4.9

Testing

  • python main_matcher.py --matcher matchanything-eloftr --device
    cuda --im_size 832 --out_dir outputs_matchanything-eloftr
  • python main_matcher.py --matcher matchanything-roma --device cuda
    --im_size 832 --out_dir outputs_matchanything-roma

Copy link
Owner

@alexstoken alexstoken left a 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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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"):
Copy link
Owner

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"):
Copy link
Owner

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):
Copy link
Owner

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants