MapAnything (fastforks)
MapAnything (Keetha et al. 2025): metric multi-view reconstruction from unposed images in one forward pass. DINOv2 ViT-g/14 features per view, 16 alternating global / per-view attention blocks with a metric-scale token, a DPT head (ray directions, depth along the ray, confidence, non-ambiguity) and pose / scale heads. Images only (the original code's optional geometric inputs are not supported). Apache-2.0 code and weights (the map-anything-apache checkpoint).
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/facebookresearch/map-anything at 3d10cf7.
Author weight repos: https://huggingface.co/facebook/map-anything-apache.
Task: multiview. Tier: experimental. Outputs: depth, confidence, mask, world_points, intrinsics, cam_to_world, metric_scale. Backends: portable, kernels.
Input: several images of one scene (posed and calibrated for multi-view stereo, unposed otherwise). Output: depth maps and, where the model predicts them, cameras and 3-D points.
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 |
|---|---|---|---|---|
mapanything-apache@1 |
model.safetensors | fa06c0fdccef |
Apache-2.0 | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Files: LICENSE.
Training data: The apache variant is trained on the subset of the paper's 13 datasets whose licences allow commercial use (README 'Models'; the exact list is in the paper). The CC-BY-NC facebook/map-anything checkpoint is not packaged..
- Licence note: The map-anything-apache weights are Apache-2.0, but the repository does not list the datasets they were trained on (the paper names the commercially usable subset), so their training-data terms are unclear here.
- Licence note: The CC-BY-NC facebook/map-anything checkpoint is not packaged.
Licence evidence: https://github.com/facebookresearch/map-anything/blob/3d10cf7/LICENSE and https://huggingface.co/facebook/map-anything-apache/blob/00f9c245bbcb60522d1ed7f9e9d88462c6e3f38a/README.md
Input size
any H x W >= 1, resized or padded inside the model
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): mapanything-apache 3000x4000 (7.1 GiB peak allocated, 9.2 reserved)
Speed and memory
Multiview, synthetic, 336x518
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
mapanything-apache |
2875.36 | 1966.81 | 635.92 | 543.98 | 3.6x | 1.2x | 10227 / 10952 | 3697 / 4092 | 3697 / 4072 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
mapanything-apache |
6.12 (336x518) | 2.89 (336x518) | 0.57โ (336x518) | 2.62 (336x518) | 0.66 (336x518) | 0.54 (336x518) |
Fixed-size speed and peak memory, all models
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
|---|---|---|---|---|---|
mapanything-apache |
portable | 680.9 ms / 3914 / 5848 | 493.1 ms / 3635 / 5196 | 498.1 ms / 3846 / 5442 | 734.6 ms / 7240 / 9442 |
mapanything-apache |
kernels | 569.7 ms / 3914 / 5846 | 415.3 ms / 3635 / 5196 | 419.9 ms / 3846 / 5442 | 622.3 ms / 7240 / 9440 |
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 authors' code 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
Parity with the original code
Every variant is checked against golden outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1 % and p99 <= 5 % of the reference's median |value|.
Usage
from fastforks import multiview
model = multiview.load("mapanything-apache") # portable PyTorch on the GPU if there is one, else the CPU
result = model(["view0.jpg", "view1.jpg", "view2.jpg"]) # the views of one scene
result.depth # [V, H, W] float32 tensor; result.kind says what the maps mean
# calibrated MVS: model(views, intrinsics=K, cam_to_world=c2w), K [N, 3, 3], c2w [N, 4, 4]
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: mapanything-apache.
Kernels backend
multiview.load("mapanything-apache", mode="kernels") runs our CUDA kernels (fastbb). 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.