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 1080x1920 – – – 200 – – – – 1967 / 2206

Depth, TUM RGB-D fr1_room, 1080x1920

model time (ms): original portable kernels kernels speed-up: vs original vs portable peak memory (MiB, allocated / reserved): original portable kernels
video-depth-anything-metric-s 10776 2005 1848 5.8x 1.1x 8264 / 11916 8203 / 8848 8208 / 8630
video-depth-anything-s 11626 1434 1284 9.1x 1.1x 8263 / 11890 8201 / 8652 8204 / 8782

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
video-depth-anything-metric-s 3.85 (1080x1920) 0.51 (1080x1920) 0.30 (480x640) 17.09 (1080x1920) 2.33 (1080x1920) 0.43 (480x640)
video-depth-anything-s 0.26 (1080x1920) 0.18 (1080x1920) 0.12† (1080x1920) 14.04 (1080x1920) 1.46 (1080x1920) 1.30 (1080x1920)

torch.compile and TensorRT

model input time: portable compile TensorRT fp16 kernels preparation: compile (cold first call) ONNX + engine build peak MiB (alloc / reserved): portable compile kernels TensorRT (engine + torch)
video-depth-anything-s 1080x1920 1434 ms 1314 ms 524 ms 1284 ms 82.7 s 181 s 8201 / 8652 7762 / 8530 8204 / 8782 2753 / 3148

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

AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean 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 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
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.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.

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.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for fastforks/video-depth-anything

Finetuned
(2)
this model

Collection including fastforks/video-depth-anything