GeoCalib (fastforks)
GeoCalib (Veicht et al., ECCV 2024): single-image camera calibration. An MSCAN-L network predicts per-pixel perspective fields (up vectors and latitude) with confidences; a differentiable Levenberg-Marquardt optimiser fits the focal length and gravity direction (roll, pitch) to them. Gives intrinsics, gravity, roll, pitch and vertical field of view.
This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/cvg/GeoCalib at 1dedb29f94fc.
Task: calibration. Tier: experimental. Outputs: intrinsics, gravity, roll, pitch, vfov. Backends: portable, kernels.
Input: one RGB image. Output: the camera intrinsics [3, 3] and, where the model estimates them, the gravity direction in the camera frame, roll, pitch and vertical field of view.
Variants
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
geocalib-pinhole@1 |
geocalib-pinhole.tar | 86d6aeacd8bb |
CC-BY-4.0 | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: LICENSE, LICENSE-WEIGHTS.
Training data: OpenPano (perspective crops of public 360-degree panoramas: PolyHaven, HDRMaps, AmbientCG, BlenderKit) (Trained on OpenPano (README, paper Sec. 4): perspective crops of ~2.8k public 360-degree panoramas (PolyHaven, HDRMaps, AmbientCG, BlenderKit). Only the weights licence (CC-BY-4.0) counts for the commercial flag.).
Licence evidence: https://github.com/cvg/GeoCalib/blob/1dedb29f94fc11b896c5f572005978aeebccd67f/LICENSE ; https://github.com/cvg/GeoCalib/blob/1dedb29f94fc11b896c5f572005978aeebccd67f/README.md
Input size
any H x W >= 32, padded to a multiple of 32
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): geocalib-pinhole 3000x4000 (0.5 GiB peak allocated, 0.6 reserved)
Speed and memory
Calibration, synthetic, 1080x1920
| model | time (ms): original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|
geocalib-pinhole |
106 | 82.3 | 82.5 | 1.3x | 1.0x | 502 / 558 | 320 / 378 | 279 / 342 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
geocalib-pinhole |
1.80 | 0.27 | 1.25 | 0.84 | 1.73 | 0.92 |
torch.compile and TensorRT
| model | input | time: portable | compile | TensorRT fp16 | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
|---|---|---|---|---|---|---|---|---|---|---|---|
geocalib-pinhole |
1080x1920 | 82.3 ms | 73.1 ms | planned for 0.2.1 | 82.5 ms | 28.4 s | β | 320 / 378 | 246 / 300 | 279 / 342 | β |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
Accuracy
On public datasets
Each image at its own size (1440 x 1920 portrait); roll, pitch and vertical field of view of the fitted camera against the ground truth; AUC of the error up to 5 degrees (errors below 1 degree count as 1, siclib's compute_auc(min_error=1)), the GeoCalib paper's protocol. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
geocalib-pinhole |
LaMAR2k, all 2000 images, roll / pitch / vertical FoV error AUC@5 degrees % | 92.6 / 76.8 / 41.6 | 92.6 / 76.8 / 41.6 | 92.6 / 76.8 / 41.6 | ||
geocalib-pinhole |
LaMAR2k, every 10th image (200), roll / pitch / vertical FoV error AUC@5 degrees % | 90.2 / 76.7 / 44.0 | 90.2 / 76.5 / 44.0 | 90.2 / 76.6 / 44.0 | 90.2 / 76.6 / 44.0 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6637f957, 2026-11-13.
Parity with the original code
Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.0032 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.087 and p99 <= 0.39 (absolute error of the output intrinsics).
Usage
from fastforks import calibration
model = calibration.load("geocalib-pinhole") # mode="auto": the preferred backend from recorded measurements
result = model("photo.jpg")
result.intrinsics # [3, 3] float32 K in input pixels
# result.roll, result.pitch, result.vfov (radians), result.gravity [3]: where the model estimates them
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: geocalib-pinhole.
Kernels backend
calibration.load("geocalib-pinhole", mode="kernels") runs our CUDA kernels (cudnn_hacc). It needs a prebuilt kernel for your GPU architecture (downloaded from https://huggingface.co/fastforks/kernels on first use) and a recent NVIDIA driver; if there is none it raises BackendUnavailableError with the reason and never falls back silently. mode="auto" picks kernels when it can run and logs the choice.