VGGT-μ: Lightweight Relative Pose Regression at Scale
Ludvig Dillén*, David Nordström*, Xinyue Zhang, Yaroslava Lochman, Janne Heikkilä, Fredrik Kahl, Viktor Larsson
VGGT-μ estimates poses for 1,000 frames in two seconds while being more accurate than VGGT-Ω.
Overview
VGGT-μ estimates the cameras of hundreds of images in a single forward pass. It predicts the relative metric pose of every pair of images together with its uncertainty, and turns them into absolute poses by anisotropic pose averaging. It is a 120M-parameter model that loops one pair of frame-attention and global-attention blocks, and processes 500 images in 1.4 s using 5.3 GiB VRAM. Known poses and focal lengths, e.g. of the reference images in visual localization, can optionally be given as input.
How to Use
from vggtmu import VGGTMu, load_images
model = VGGTMu.from_pretrained().cuda()
images = load_images(["a.jpg", "b.jpg", "c.jpg"]).cuda() # long side 256
out = model.predict(images)
out["extrinsics"] # (1, N, 3, 4) camera-from-world, the first camera at the identity
out["intrinsics"] # (1, N, 3, 3) for the input resolution
out["scale"] # (1,) metres per unit of the translations
uv run --extra eval demo.py <folder> writes the cameras of a folder of images to cameras.npz. predict uses anisotropic pose averaging by default. Known poses and focal lengths are given with vggtmu.build_conditioning; the predicted cameras are then in the frame of the given poses (Conditioning.to_input_frame).
For a video, Odometry tracks frames against cached keyframe blocks and keeps a pose graph with loop closures (pip install vggtmu[odometry]):
from vggtmu.odometry import Odometry
vo = Odometry(model)
for image in load_images(video_frames): # one at a time works too
vo.add(image)
poses = vo.finish() # (N, 4, 4) camera-to-world, in metres
Setup/Install
pip install vggtmu
or, from a clone of this repository,
uv sync
Benchmarks
Run from a clone of this repository; each command installs what its benchmark needs (--extra eval, sfm or odometry). Each benchmark reads its data from data/ by default; download it yourself as described below. Results are written to results/.
Multi-view relative pose on RealEstate10K. Download the test split from the source and save the frames of each test sequence in order as data/re10k_test/<sequence>/images/0000.png, 0001.png, ... (640x360). Our annotations, re10k_test.jgz, download automatically.
uv run --extra eval eval.py relpose
Visual localization on Cambridge Landmarks. The official release of the five scenes in data/cambridge/<Scene>. Each query is localized from its 10 nearest training images (NetVLAD), given their poses (--cond poses) and also all focal lengths (--cond poses+focals).
uv run --extra eval eval.py visloc --cond poses+focals
Global SfM on IMC 2023. VGGT-μ's poses and focal lengths seed COLMAP, which triangulates the SIFT matches and runs bundle adjustment. The five phototourism scenes of the IMC 2023 training set in data/imc2023/train/phototourism/<scene>. Matching needs a CUDA build of COLMAP 4.1.1; pycolmap has x86-64 wheels only.
uv run --extra sfm eval.py sfm --colmap /path/to/colmap
Visual odometry on Cambridge Landmarks and ETH3D SLAM. Eight Cambridge sequences from the official release in data/cambridge/<Scene>/<seq>, with the retriangulated ground truth unzipped into data/cambridge. The six ETH3D SLAM training sequences and the official evaluator download to data/eth3d-slam on first use (needs CMake and a C++ compiler).
uv run --extra odometry eval.py odometry --dataset cambridge
uv run --extra odometry eval.py odometry --dataset eth3d
Runtime and memory.
uv run --extra eval eval.py complexity
Expected Results
The code in this repository reproduces the paper's numbers.
Paper vs. this repository
| Benchmark | Metric | Paper | This repository |
|---|---|---|---|
| RealEstate10K | AUC@30 / AUC@3 | 92.27 / 55.41 | 92.26 / 55.41 |
| Cambridge, poses | median m / ° / % within (0.5 m, 5°) | 0.31 / 0.32 / 74.0 | 0.31 / 0.32 / 74.1 |
| Cambridge, poses + focals | median m / ° / % within (0.5 m, 5°) | 0.18 / 0.31 / 87.1 | 0.18 / 0.31 / 87.1 |
| Odometry, Cambridge | ATE m / peak VRAM GiB | 1.13 / 0.6 | 1.09 / 0.63 |
| Odometry, ETH3D SLAM | ATE m / peak VRAM GiB | 0.54 / 0.7 | 0.56 / 0.65 |
| Global SfM, IMC 2023 | AUC@0.5 / 1 / 5 / 10 | 40.6 / 56.2 / 81.3 / 87.0 | 40.6 / 56.2 / 81.3 / 87.0 |
| Runtime, 500 frames | s / GiB (GH200) | 1.4 / 5.3 | 1.36 / 5.30 |
Training
Training supervises on ground-truth poses and intrinsics while distilling VGGT-Ω at 256 px on MegaDepth (data/megadepth with prep_scene_info/, as in DKM). It needs the DINOv3 ViT-B/16 weights for the encoder and the VGGT-Ω 256 px checkpoint for the teacher.
uv sync --extra train
uv pip install git+https://github.com/facebookresearch/vggt-omega
uv run --no-sync torchrun --nproc-per-node 4 train.py --name megadepth \
--dinov3 dinov3_vitb16_pretrain_lvd1689m-73cec8be.pth --teacher vggt_omega_1b_256_text.pt
The released model was trained the same way on a mix of 19 datasets, which this repository does not include.
Pretrained Weights
The weights download when the model is created. Direct link: vggtmu.pt.
Checklist
- Publish a depth head.
Citation
@article{dillen2026vggtmu,
title = {{VGGT-$\mu$}: Lightweight Relative Pose Regression at Scale},
author = {Dill{\'e}n, Ludvig and Nordstr{\"o}m, David and Zhang, Xinyue and Lochman, Yaroslava and Heikkil{\"a}, Janne and Kahl, Fredrik and Larsson, Viktor},
journal = {arXiv preprint arXiv:2604.04931},
year = {2026}
}
License
MIT. The DINOv3 encoder weights are under the DINOv3 License.
Metadata
Release files for vggtmu 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vggtmu-1.0.0.tar.gz | 45.9 kB | Without provenance | Details for vggtmu-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vggtmu-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for vggtmu-1.0.0-py3-none-any.whl |
Total release size: 102.0 kB
Release files / vggtmu-1.0.0.tar.gz
| Download URL | vggtmu-1.0.0.tar.gz |
|---|---|
| Size | 45.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2089ba0df667d91308822d676f7afe58f1662c2359b21aa51e3067ad68167f8b
|
|
BLAKE2b-256 checksum How to use checksums |
75214fc2559985ab158f7d23807d46b9f341a26d32ae003ac3347fc49e5822db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vggtmu-1.0.0-py3-none-any.whl
| Download URL | vggtmu-1.0.0-py3-none-any.whl |
|---|---|
| Size | 56.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9270b0652e7cf82ee8e36a10860e5b3ddc4a5328385fb13ad794cace108effe
|
|
BLAKE2b-256 checksum How to use checksums |
4d1c5a9da9a0e87c151dc45976132c0125adc4c269e8c0c5fa70432a2e90d447
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for vggtmu 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.