AnyCalib — MLX weights

Converted weights for mlx-swift-AnyCalib, a Swift/MLX port of AnyCalib (Tirado-Garín & Civera, ICCV 2025): single-view camera calibration with a camera model chosen after the network runs.

These are not new weights. They are the official AnyCalib checkpoints in a different container.

What was changed

  • Repacked from PyTorch .pt into safetensors.
  • Convolution tensors transposed (out, in, kH, kW) → (out, kH, kW, in) for MLX's native NHWC layout. That same rule also reshapes the (1, 3, 1, 1) ImageNet mean/std buffers to (1, 1, 1, 3).
  • Optionally cast to float16; the default build is float32.

No weight values are altered beyond that optional cast. The port is verified stage by stage against the PyTorch reference — on MLX's CPU backend every stage matches to within float32's own noise floor (ray field within 0.0003°).

Layout

One subdirectory per pretrained variant, each holding config.json and weights.safetensors:

anycalib_dist/
anycalib_edit/
anycalib_gen/
anycalib_pinhole/

The variants differ only in training imagery: pinhole (perspective only), gen (perspective + distorted), dist (distorted + strongly distorted), edit (stretched and cropped perspective).

Usage

anycalib calibrate photo.jpg --cam pinhole --repo mnmly/anycalib-mlx

The Swift loader resolves these through the shared Hugging Face cache, so a copy pulled by huggingface_hub is reused and vice versa.

License and attribution

Apache 2.0, inherited from upstream. See LICENSE and NOTICE in this repo.

Original work © Javier Tirado-Garín and Javier Civera, I3A, University of Zaragoza. The backbone is DINOv2, © Meta Platforms, Inc., also Apache 2.0.

@InProceedings{tirado2025anycalib,
  author={Javier Tirado-Gar{\'i}n and Javier Civera},
  title={{AnyCalib: On-Manifold Learning for Model-Agnostic Single-View Camera Calibration}},
  booktitle={ICCV},
  year={2025}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mnmly/anycalib-mlx

Base model

javrtg/AnyCalib
Finetuned
(1)
this model