Skip to content

Remove read_write_model.py and raw sqlite3 in favor of pycolmap - #519

Draft
sarlinpe wants to merge 1 commit into
refresh/2-pip-no-submodulesfrom
refresh/3-remove-read-write-model
Draft

sarlinpe wants to merge 1 commit into
refresh/2-pip-no-submodulesfrom
refresh/3-remove-read-write-model

Conversation

@sarlinpe

@sarlinpe sarlinpe commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Delete hloc/utils/read_write_model.py (588 LOC) and eliminate raw sqlite3 queries by offloading all COLMAP model and database I/O to pycolmap.Reconstruction, pycolmap.Database, pycolmap.Rotation3d, pycolmap.Rigid3d, and pycolmap.Camera (PR 3 of 7 in Stack #524, stacked on #518).

Changes

  • Delete hloc/utils/read_write_model.py.
  • Migrate hloc/colmap_from_nvm.py and hloc/pipelines/RobotCar/colmap_from_nvm.py from raw sqlite3 + read_write_model to pycolmap.Database.open and pycolmap.Reconstruction (using vectorized Image(..., keypoints=xys) and normalized Rotation3d).
  • Migrate hloc/pairs_from_covisibility.py, hloc/pairs_from_poses.py, and hloc/pairs_from_retrieval.py to pycolmap.Reconstruction.
  • Migrate hloc/pipelines/4Seasons/utils.py, hloc/pipelines/7Scenes/{create_gt_sfm.py,utils.py}, and hloc/pipelines/Cambridge/{utils.py,pipeline.py} to pycolmap.Reconstruction, Camera.rescale, and Rotation3d, removing the redundant ext input-extension flag so COLMAP auto-discovers .bin/.txt models via pycolmap.Reconstruction(path).

Superseded Open PRs (to be noted after review)

  • Supersedes #509 (UTF-8 image names in read_write_model.py are natively handled by pycolmap.Reconstruction).

Verification

  • Verified all migrated modules end-to-end against pycolmap 4.2.1, including auto-discovery of .bin, .txt, and legacy 3-file COLMAP text models via pycolmap.Reconstruction(path).

@sarlinpe
sarlinpe force-pushed the refresh/3-remove-read-write-model branch from 72ce168 to 9c9a25a 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