Skip to content

Conversation

@disk02
Copy link
Owner

@disk02 disk02 commented Jan 11, 2026

Motivation

  • Provide optional focal length estimation at inference time using GeoCalib to improve intrinsics when EXIF is missing or unreliable.
  • Support both per-image calibration and an optional per-folder shared-intrinsics mode to amortize GeoCalib cost.
  • Keep camera model fixed to pinhole and avoid writing calibration artifacts to disk.
  • Fail gracefully to preserve existing behavior when GeoCalib is disabled or fails.

Description

  • Added a GeoCalib adapter src/sharp/utils/geocalib.py that lazily imports geocalib, holds a single runner instance, and exposes calibrate_image and calibrate_folder returning a scalar f_px extracted robustly from varied GeoCalib return shapes.
  • Extended src/sharp/cli/predict.py with --geocalib and --geocalib-per-folder flags, instantiated GeoCalibRunner on demand using CPU for mps devices, and integrated per-image or per-folder focal overrides while keeping original EXIF fallback.
  • Added per-folder precomputation and in-memory cache (folder_fpx_cache) when --geocalib-per-folder is enabled, and logged concise info on computed folder focals and warnings when GeoCalib fails and EXIF fallback is used.
  • Updated requirements.txt to add GeoCalib as a direct dependency via geocalib @ git+https://github.com/cvg/GeoCalib.git.

Testing

  • No automated tests were executed as part of this change.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants