Video Depth Anything (fastforks)
Video Depth Anything (Chen et al., CVPR 2025): temporally consistent depth of long videos from the Depth Anything V2 encoder and a DPT head with temporal attention, run in overlapping 32-frame windows; relative (Small) and metric (Metric Small) checkpoints.
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/DepthAnything/Video-Depth-Anything at 4f5ae23172ba.
Author weight repos: https://huggingface.co/depth-anything/Metric-Video-Depth-Anything-Small, https://huggingface.co/depth-anything/Video-Depth-Anything-Small.
Task: depth. Tier: experimental. Outputs: inverse_depth, depth. Backends: portable, kernels.
Input: one RGB image. Output: a depth or inverse-depth map. kind (a card field, result.kind) says what the numbers mean: metric = metres; scale_invariant, affine_invariant, affine_invariant_log (log depth) and affine_invariant_inverse are relative (unknown scale or shift, not metres). Metric models that use the focal length take model(image, intrinsics=K) (K [3, 3], pixels of the input): metric3d-vit-large and da3metric-large need it for correct metres (da3metric-large: metres = output x focal / 300; without intrinsics= a 300 px focal length is assumed, wrong for a real camera). unidepth-v2-vitl14, unik3d-vitl, depth-pro and MoGe estimate the camera themselves (given intrinsics= replace fx); zoedepth-nk and the relative models (da3mono-large too) take none. Normals-only models (kind none) return result.normals [B, H, W, 3] (unit vectors, camera frame: x right, y down, z forward).
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 |
|---|---|---|---|---|
video-depth-anything-metric-s@1 |
metric_video_depth_anything_vits.pth | 3c28432b4e1f |
Apache-2.0 | yes |
video-depth-anything-s@1 |
video_depth_anything_vits.pth | 13379300b739 |
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. Licence files: LICENSE.
Training data: Depth Anything V2 Small encoder; the temporal head on synthetic video depth and pseudo-labelled real videos and images per the paper (arXiv 2501.12375).
- Licence note: Only the Small checkpoints (relative and metric) are Apache-2.0; the Base and Large checkpoints are CC-BY-NC-4.0 and not included.
- Licence note: The metric model is trained on Virtual KITTI 2 (CC BY-NC-SA 3.0) and IRS per the upstream README (a note only).
Licence evidence: https://github.com/DepthAnything/Video-Depth-Anything/blob/4f5ae23172ba60fd7bc11ef671cca678842c7072/LICENSE (Apache-2.0); https://huggingface.co/depth-anything/Video-Depth-Anything-Small/blob/256875362cff76724b920335dfb4b29dd611f66e/README.md (license: apache-2.0)
Input size
any H x W >= 1, resized or padded inside the model
Tested up to (portable, fp16, RTX 5060 Ti 16 GB): video-depth-anything-metric-s 3000x4000 (1.8 GiB peak allocated, 3.5 reserved); video-depth-anything-s 3000x4000 (1.8 GiB peak allocated, 3.5 reserved)
Speed and memory
Depth, synthetic
| model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|---|
video-depth-anything-metric-s |
994x1482 | 1812 | 1437 | 161 | 61.8 | 23.3x | 2.6x | 5609 / 8422 | 1083 / 1764 | 852 / 1146 |
video-depth-anything-s |
994x1482 | 1814 | 1441 | 161 | 62.2 | 23.2x | 2.6x | 5609 / 8422 | 1083 / 1766 | 852 / 1146 |
Depth, Synthetic 32-frame clip, 32x994x1482
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
video-depth-anything-metric-s |
3900 | 3018 | 822 | 627 | 4.8x | 1.3x | 5935 / 8422 | 1368 / 1666 | 1259 / 1636 |
video-depth-anything-s |
4175 | 3064 | 824 | 629 | 4.9x | 1.3x | 5935 / 8422 | 1368 / 1666 | 1259 / 1636 |
Depth, TUM RGB-D fr1_room, 88x1080x1920
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
video-depth-anything-metric-s |
11337 | 10776 | 1423 | 1232 | 8.7x | 1.2x | 8264 / 11916 | 6207 / 6504 | 6288 / 6466 |
video-depth-anything-s |
12158 | 11626 | 1423 | 1233 | 9.4x | 1.2x | 8263 / 11890 | 6207 / 6524 | 6288 / 6486 |
Depth, Synthetic 40-frame clip, 40x480x640
| model | time (ms): portable | kernels | kernels speed-up: vs portable | peak memory (MiB, allocated / reserved): portable | kernels |
|---|---|---|---|---|---|
video-depth-anything-s |
458 | 376 | 1.2x | 1231 / 1406 | 1297 / 1406 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
video-depth-anything-metric-s |
0.39 | 0.19 (480x640) | 0.19 (480x640) | 1.83 | 0.44 (480x640) | 0.50 (480x640) |
video-depth-anything-s |
0.40 | 0.98 (480x640) | 0.38 (480x640) | 1.84 | 0.54 (480x640) | 0.37 (480x640) |
torch.compile and TensorRT
| model | input | time: portable | compile | TensorRT (fp16 unless shown) | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
|---|---|---|---|---|---|---|---|---|---|---|---|
video-depth-anything-metric-s |
480x640 | 147 ms | 101 ms (single image) | 60.2 ms (single image) | 59.5 ms | 32.5 s | 82.1 s | 953 / 1146 | 1143 / 1464 | 988 / 1188 | 886 / 914 |
video-depth-anything-metric-s |
994x1482 | 161 ms | 112 ms (single-image call, CUDA tensor input) | 67.7 ms (single-image engine) | 61.8 ms | 34.2 s | 92.5 s | 1083 / 1764 | 1263 / 1524 | 852 / 1146 | 988 / 1022 |
video-depth-anything-metric-s |
32x994x1482 | 822 ms | 721 ms (32-frame clip, decoded CPU RGB to CPU depth) | 253 ms (32-frame clip, CUDA tensors in and out) | 627 ms | 65.9 s | 110 s | 1368 / 1666 | 1513 / 1992 | 1259 / 1636 | 1995 / 2370 |
video-depth-anything-s |
88x1080x1920 | 1423 ms | 1314 ms (full 88-frame clip) | β | 1233 ms | 82.7 s | β | 6207 / 6524 | 7762 / 8530 | 6288 / 6486 | β |
video-depth-anything-s |
480x640 | 147 ms | 100 ms (single image) | 60.3 ms (single image) | 58.4 ms | 34.8 s | 103 s | 953 / 1146 | 1143 / 1344 | 988 / 1188 | 886 / 914 |
video-depth-anything-s |
88x480x640 | 954 ms | 762 ms (full 88-frame clip) | 524 ms (full 88-frame clip) | 835 ms | 51.8 s | 181 s | 1730 / 1946 | 2587 / 3260 | 1796 / 1946 | 2753 / 3148 |
video-depth-anything-s |
994x1482 | 161 ms | 112 ms (single-image call, CUDA tensor input) | 67.7 ms (single-image engine) | 62.2 ms | 33.6 s | 100 s | 1083 / 1766 | 1263 / 1524 | 852 / 1146 | 988 / 1022 |
video-depth-anything-s |
32x994x1482 | 824 ms | 719 ms (32-frame clip, decoded CPU RGB to CPU depth) | 253 ms (32-frame clip, CUDA tensors in and out) | 629 ms | 62.9 s | 104 s | 1368 / 1666 | 1513 / 1990 | 1259 / 1636 | 1995 / 2370 |
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
Aligned depth scores fit scale and shift by least squares, in disparity space for inverse-depth models. Metric depth scores follow each dataset's protocol. Both average over images. Video: one call per sequence, one scale + shift per sequence, AbsRel / delta1 over all its pixels with Kinect depth, mean over sequences. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
video-depth-anything-s |
TUM RGB-D video (3 sequences, first 110 frames each), AbsRel / delta1 | 0.0549 / 0.9802 | 0.0549 / 0.9802 | 0.0550 / 0.9802 | 0.0549 / 0.9802 | 0.0549 / 0.9802 | |
video-depth-anything-s |
TUM RGB-D video (3 sequences, first 1000 frames each), AbsRel / delta1 | 0.1120 / 0.8716 | |||||
video-depth-anything-metric-s |
TUM RGB-D video (3 sequences, first 110 frames each), AbsRel / delta1 | 0.0786 / 0.9769 | 0.0785 / 0.9769 | 0.0786 / 0.9769 | 0.0786 / 0.9769 | 0.0785 / 0.9769 | |
video-depth-anything-metric-s |
TUM RGB-D video (3 sequences, first 1000 frames each), AbsRel / delta1 | 0.1214 / 0.8883 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks a49aaba7, 2026-11-12.
Parity with the original code
Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 1.3e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.42 % and p99 <= 0.55 % of the reference's median |value| (absolute error of the output inverse_depth).
Limitations
model.video(frames)runs one video in time order (each window attends over time and is aligned to the previous one); calling the model with an image or a batch runs each image as a one-frame video.- Every video runs at least one 32-frame window (shorter videos are padded with copies of their last frame): one image costs about as much as 32 frames in the temporal head.
- The whole video's depth is kept on the device as float32 (L x H x W); split very long videos.
- Video Depth Anything Small at 40 frames of 480 Γ 640 in FP16 uses 1,231 MiB portable and 1,297 MiB kernels on an RTX 5060 Ti, with warm medians of 458.1 and 375.8 ms. Depth matches bitwise on this clip and three labeled TUM clips within each mode.
Usage
from fastforks import depth
model = depth.load("video-depth-anything-metric-s") # mode="auto": the preferred backend from recorded measurements
result = model("room.jpg")
result.inverse_depth # [H, W] float32 tensor; result.kind says what the maps mean
# models that take a camera: model("room.jpg", intrinsics=K), K [3, 3] in pixels
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: video-depth-anything-metric-s, video-depth-anything-s.
Kernels backend
depth.load("video-depth-anything-metric-s", 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.