Skip to content

Make hloc pip-installable via pyproject.toml and remove git submodules - #518

Draft
sarlinpe wants to merge 1 commit into
refresh/1-colmap-4.2from
refresh/2-pip-no-submodules
Draft

sarlinpe wants to merge 1 commit into
refresh/1-colmap-4.2from
refresh/2-pip-no-submodules

Conversation

@sarlinpe

@sarlinpe sarlinpe commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Make hloc directly pip-installable without --recursive clones by migrating packaging to PEP 621 pyproject.toml and removing all 4 third_party/ git submodules (PR 2 of 6 in Stack #525, stacked on #517).

Changes

  • Delete .gitmodules and all 4 git submodules (third_party/{SuperGluePretrainedNetwork,d2net,deep-image-retrieval,r2d2}).
  • Vendor the SuperGlue model implementation from SuperGluePretrainedNetwork (retaining its Magic Leap license header) into hloc/matchers/superglue_impl.py — downloading pretrained indoor/outdoor weights via torch.hub.load_state_dict_from_url pinned to commit ddcf11f42e7e0732a0c4607648f9448ea8d73590 — and keep hloc/matchers/superglue.py as the thin Apache-2.0 wrapper with all existing superglue defaults intact.
  • Migrate hloc/extractors/superpoint.py to lightglue.SuperPoint (preserving fix_sampling, pixel-center coordinates, and (B, D, N) descriptors).
  • Drop D2-Net, R2D2, and DIR (AP-GeM) extractors.
  • Replace setup.py + requirements.txt with PEP 621 pyproject.toml (setuptools>=77.0.3, requires-python = ">=3.10", drops unused gdown), and update Dockerfile, README.md, and hloc/utils/viz_3d.py (black Python 3.10 trailing commas).

Superseded Open PRs (to be noted after review)

  • Supersedes #334 and submodule portions of #489.

Verification

  • Verified editable & wheel builds, flake8/isort/black, SuperPoint (fix_sampling=True/False, blank image, max_keypoints), SuperGlue (outdoor, indoor, and zero-keypoint forward passes via dynamic_load), and SuperPoint + SuperGlue Sacre Coeur SfM reconstruction (4/4 images, 269 3D points).

@sarlinpe
sarlinpe force-pushed the refresh/2-pip-no-submodules branch from dbae9b4 to 4995bbf Compare November 22, 2026 14:27
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.

1 participant