Models · Camera calibration

GeoCalib

GeoCalib (ETH Zurich / Microsoft, 2024): the camera of one photo (focal length, field of view) and how it is tilted (roll, pitch from gravity), from perspective fields and an optimisation; no checkerboard needed. Apache-2.0 code, CC-BY-4.0 weights; training photos of mixed licences.

experimental Fork of cvg/GeoCalib@1dedb29 · backends: portable, kernels

Checkpoint geocalib-pinhole

Paper 2024 Added in 0.2.0 Evaluated with 0.2.0

Portable, RTX 5060 Ti 16 GB 81.2 ms 1080x1920, fp16
vs the faster original 1.3× original fp16: 106 ms
Peak memory 320 MiB original: 502 MiB
Accuracy vs original fp32 +0.0 kernels roll_auc5, LaMAR2k (92.6 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import calibration

model = calibration.load("geocalib-pinhole")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.intrinsics  # also: gravity, roll, pitch, vfov
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench geocalib-pinhole

Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.

Speed and memory

Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.

Input: synthetic, 1080x1920 (the task’s standard size)

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original fp16torch.autocast(float16) around the call; cvg/GeoCalibdedb29f94fc GeoCalib.calibrate (pinhole), its kornia resize / crop / LM fitfp16 106–502 MiB/558 MiB0.41.48
Portable fp32fp32not measured ––––
Portablefp16 81.21.3×320 MiB/378 MiB0.31.84
Kernelsfp16 81.81.3×277 MiB/338 MiB0.40.74
Portable + torch.compile 73.11.5×246 MiB/300 MiB28 (build)–
TensorRTplanned for 0.2.1fails––––

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-13 to 2026-11-15. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.

Other devices

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14Originalfp32529 1,908 MiB process–1080x1920
Portablefp16427 1,644 MiB processmatches1080x1920
Portablefp32517 1,717 MiB processmatches1080x1920
Kernelsfp16not implemented–1080x1920

CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.

Licence and weights

Commercial use allowed

Code
Apache-2.0 LICENSELICENSE-WEIGHTS
Weights
CC-BY-4.0 source
Training data

Our reading of the licences, not legal advice.

Weights

geocalib-pinhole.tar 116 MB· hosted on GitHub

fastforks downloads and checks these files on first use (fastforks download geocalib-pinhole).

Accuracy

The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.

LaMAR2k

all 2000 images, roll / pitch / vertical FoV error AUC@5 degrees %

Rundtyperoll_auc5 ↑pitch_auc5 ↑vfov_auc5 ↑Δ roll_auc5 vs fp32 originalimagesms / image
Original fp32fp3292.676.841.6 reference 2000 117
Original fp16not measured
Portable fp32fp3292.676.841.6 ±0.0 2000 93.1
Portablefp1692.676.841.6 +0.0 2000 83.0
Kernelsfp1692.676.841.6 +0.0 2000 85.3

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 authors’ code, same checkpoint and protocol. Measured on original fp32: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks ce213f43, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6637f957, 2026-11-13.

LaMAR2k

every 10th image (200), roll / pitch / vertical FoV error AUC@5 degrees %

Rundtyperoll_auc5 ↑pitch_auc5 ↑vfov_auc5 ↑Δ roll_auc5 vs fp32 originalimagesms / image
Original fp32fp3290.276.744.0 reference 200 116
Original fp16fp1690.276.544.0 +0.0 200 101
Portable fp32fp3290.276.744.0 ±0.0 200 91.6
Portablefp1690.276.644.0 +0.0 200 83.0
Kernelsfp1690.276.644.0 +0.0 200 85.3

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 authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6637f957, 2026-11-13.

Closeness to the original

Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. 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).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.0032 not recorded
GPU default dtypes, mean |diff|≤ 0.087 0.05777
GPU default dtypes, p99 |diff|≤ 0.39 0.25995

Recorded for geocalib-pinhole on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13, with these kernels: cudnn_hacc

Details

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.

Input / output
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.
Input size
any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (502 MiB allocated)
Options
  • cuda_graphs=true
Outputs
intrinsics, gravity, roll, pitch, vfov
CUDA kernels
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
Apple (MPS)
fp32, fp16

Limitations

  • The Levenberg-Marquardt loop branches and logs on its convergence (35 graph breaks: `torch.compile` runs with breaks, no `torch.export`); its damping, singularity check and early stop are batch-wide, as upstream, so a batch is one problem and an image's result can depend on its batch mates.
Full reference, generated from the repository

GeoCalib (ETH Zurich / Microsoft, 2024): the camera of one photo (focal length, field of view) and how it is tilted (roll, pitch from gravity), from perspective fields and an optimisation; no checkerboard needed. Apache-2.0 code, CC-BY-4.0 weights; training photos of mixed licences.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
geocalib-pinholesynthetic (1080x1920)original
portable
kernels
portable + torch.compile
TensorRT fp16
106
81.2
81.8
73.1
planned for 0.2.1
502 / 558
320 / 378
277 / 338
246 / 300
–
Details
  • Original code: https://github.com/cvg/GeoCalib at 1dedb29f94fc
  • Code licence: Apache-2.0 (permissive); files: LICENSE, LICENSE-WEIGHTS
  • Weights licence: CC-BY-4.0
  • Licence evidence: https://github.com/cvg/GeoCalib/blob/1dedb29f94fc11b896c5f572005978aeebccd67f/LICENSE ; https://github.com/cvg/GeoCalib/blob/1dedb29f94fc11b896c5f572005978aeebccd67f/README.md
  • 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.)
  • Options: cuda_graphs = True (speed only)
  • Kernel libraries: cudnn_hacc
  • Variants: geocalib-pinhole
  • Not in this release (planned for 0.2.1): geocalib-pinhole ONNX / TensorRT export: dynamic optimizer convergence and unsupported ONNX Cholesky decomposition
  • Outputs: intrinsics, gravity, roll, pitch, vfov
  • 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)
  • geocalib-pinhole 1080x1920, first call: portable + torch.compile 28 s (cold Inductor cache).
  • geocalib-pinhole original 1080x1920: torch.autocast(float16) around the call; cvg/GeoCalibdedb29f94fc GeoCalib.calibrate (pinhole), its kornia resize / crop / LM fit
  • geocalib-pinhole load / first call: original 1.8 s / 0.841 s, portable 0.27 s / 1.837 s, kernels 0.44 s / 0.745 s
  • Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5

Measured

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.

variantdatasetoriginal fp32original fp16portableportable fp32kernelsnote
geocalib-pinholeLaMAR2k, all 2000 images, roll / pitch / vertical FoV error AUC@5 degrees %92.6 / 76.8 / 41.692.6 / 76.8 / 41.692.6 / 76.8 / 41.692.6 / 76.8 / 41.6
geocalib-pinholeLaMAR2k, every 10th image (200), roll / pitch / vertical FoV error AUC@5 degrees %90.2 / 76.7 / 44.090.2 / 76.5 / 44.090.2 / 76.6 / 44.090.2 / 76.7 / 44.090.2 / 76.6 / 44.0

Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6637f957, 2026-11-13; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6637f957 / ce213f43, 2026-11-13 to 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6637f957, 2026-11-13.

Parity

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).

variantkernels error vs original, mean / p99GPU, torchkernels used
geocalib-pinhole0.05777 / 0.25995RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400

Limitations

  • The Levenberg-Marquardt loop branches and logs on its convergence (35 graph breaks: torch.compile runs with breaks, no torch.export); its damping, singularity check and early stop are batch-wide, as upstream, so a batch is one problem and an image's result can depend on its batch mates.

Example output

No example rendered for this checkpoint yet.