Models · Monocular depth

Video Depth Anything

Video Depth Anything (ByteDance): depth of a whole clip via `model.video(frames)` (a plain call treats frames as independent), consistent over time; relative and metric. Apache-2.0 code and weights (Small only).

experimental Fork of DepthAnything/Video-Depth-Anything@4f5ae23 · backends: portable, kernels

Checkpoint

Paper 2025 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 200 ms 1080x1920, fp16
vs the faster original 58.2× original fp16: 11626 ms
Peak memory 1,967 MiB original: 8,263 MiB
Accuracy vs original fp32 ±0.0000 kernels AbsRel, TUM RGB-D video (3 sequences (0.0549 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import depth

model = depth.load("video-depth-anything-s")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.inverse_depth  # also: depth
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench video-depth-anything-s

Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.

Speed and memory

Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original fp16upstream infer_video_depth(input_size=518, fp32=False): uint8 numpy frames in, numpy out (its API); the authors' autocast fp16fp16 11626–8,263 MiB/11.6 GiB0.312.77
Portable fp32fp32not measured ––––
Portablefloat CUDA frames in [0, 1] in, depth [L, H, W] on the device outfp16 20258×1,962 MiB/2,204 MiB1.00.20
Kernelsfloat CUDA frames in [0, 1] in, depth [L, H, W] on the device outfp16 20058×1,967 MiB/2,226 MiB0.40.20
Portable + torch.compilenot measured here ––––
TensorRTnot measured here ––––

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-12 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.

Other devices

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14Originalfp32cannot run here–480x640
Portablefp16926 6,506 MiB processmatches480x640
Portablefp32823 7,546 MiB processmatches480x640
Kernelsfp16not implemented–480x640

CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.

Licence and weights

Commercial use allowed

Code
Apache-2.0 LICENSE
Weights
Apache-2.0 source
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)
  • 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.
  • The metric model is trained on Virtual KITTI 2 (CC BY-NC-SA 3.0) and IRS per the upstream README (a note only).

Our reading of the licences, not legal advice.

Weights

video_depth_anything_vits.pth 116 MB· hosted on Hugging Face

fastforks downloads and checks these files on first use (fastforks download video-depth-anything-s).

Accuracy

The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.

TUM RGB-D video (3 sequences

first 110 frames each), AbsRel / delta1

RundtypeAbsRel ↓δ1 ↑Δ AbsRel vs fp32 originalimagesms / image
Original fp32fp320.05490.9802 reference 330 63.3
Original fp16fp160.05490.9802 ±0.0000 330 47.6
Portable fp32fp320.05490.9802 ±0.0000 330 29.3
Portablefp160.05500.9802 −0.0001 330 12.1
Kernelsfp160.05490.9802 ±0.0000 330 10.9

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 authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks a49aaba7, 2026-11-12.

TUM RGB-D video (3 sequences

first 1000 frames each), AbsRel / delta1

RundtypeAbsRel ↓δ1 ↑imagesms / image
Original fp32not measured
Original fp16not measured
Portable fp32not measured
Portablenot measured
Kernelsfp160.11200.8716 2938 10.9

The original code was not run on this dataset, so the table cannot show the distance to it.

AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks a49aaba7, 2026-11-12.

Closeness to the original

Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. 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).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.000013 (relative)not recorded
GPU default dtypes, mean |diff|≤ 0.0042 (relative)0.00042 (relative)
GPU default dtypes, p99 |diff|≤ 0.0055 (relative)0.00105 (relative)

Recorded for video-depth-anything-s on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12, with these kernels: fastbb

Details

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.

Input / output
Input: one RGB image. Output: a depth or inverse-depth map.
What the numbers mean, and which models need the camera focal length

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).

Input size
any H x W >= 1, resized or padded inside the model; tested up to 3000x4000 (1,799 MiB allocated)
Options
  • short_side=518>= 14· changes the output
Outputs
inverse_depth, depth
Checkpoint
arch="vits"
CUDA kernels
  • fastbbfast backbone kernels: flash attention, window attention, instance norm and rotary embeddings for ViT and similar backbones
Apple (MPS)
fp32, fp16

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.
Full reference, generated from the repository

Video Depth Anything (ByteDance): depth of a whole clip via model.video(frames) (a plain call treats frames as independent), consistent over time; relative and metric. Apache-2.0 code and weights (Small only).

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
video-depth-anything-sTUM RGB-D fr1_room (1080x1920)original
portable
kernels
11626
202
200
8263 / 11890
1962 / 2204
1967 / 2226
video-depth-anything-sTUM RGB-D fr1_room (480x640)original
portable
kernels
portable + torch.compile
TensorRT fp16
3786
148
146
100
60.3
4780 / 6794
1461 / 1646
1465 / 1666
1143 / 1344
886 / 914
video-depth-anything-metric-sTUM RGB-D fr1_room (1080x1920)original
portable
kernels
10776
202
200
8264 / 11916
1962 / 2224
1967 / 2226
video-depth-anything-metric-sTUM RGB-D fr1_room (480x640)original
portable
kernels
portable + torch.compile
TensorRT fp16
4012
148
147
101
60.2
4780 / 6806
1461 / 1666
1465 / 1646
1143 / 1464
886 / 914
Details
  • Original code: https://github.com/DepthAnything/Video-Depth-Anything at 4f5ae23172ba
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0
  • 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)
  • 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).
  • Options: short_side = 518 (>= 14; also input_size)
  • Kernel libraries: fastbb
  • Variants: video-depth-anything-s, video-depth-anything-metric-s
  • Outputs: inverse_depth, depth; kind: affine_invariant_inverse
  • 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-s 3000x4000 (1.8 GiB peak allocated, 3.5 reserved); video-depth-anything-metric-s 3000x4000 (1.8 GiB peak allocated, 3.5 reserved)
  • video-depth-anything-s 480x640, first call: portable + torch.compile 35 s (cold Inductor cache), TensorRT fp16 103 s (ONNX + engine).
  • video-depth-anything-metric-s 480x640, first call: portable + torch.compile 33 s (cold Inductor cache), TensorRT fp16 82 s (ONNX + engine).
  • video-depth-anything-s original 1080x1920, original 480x640: upstream infer_video_depth(input_size=518, fp32=False): uint8 numpy frames in, numpy out (its API); the authors' autocast fp16
  • video-depth-anything-s portable 1080x1920, kernels 1080x1920, portable 480x640, kernels 480x640: float CUDA frames in [0, 1] in, depth [L, H, W] on the device out
  • video-depth-anything-metric-s original 1080x1920, original 480x640: upstream infer_video_depth(input_size=518, fp32=False): uint8 numpy frames in, numpy out (its API); the authors' autocast fp16
  • video-depth-anything-s load / first call: original 0.26 s / 14.043 s (1080x1920), portable 0.98 s / 0.539 s (480x640), kernels 0.38 s / 0.37 s (480x640)
  • video-depth-anything-metric-s load / first call: original 3.85 s / 17.094 s (1080x1920), portable 0.19 s / 0.436 s (480x640), kernels 0.19 s / 0.5 s (480x640)
  • Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5

Measured

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.

variantdatasetoriginal fp32original fp16portableportable fp32kernelsnote
video-depth-anything-sTUM RGB-D video (3 sequences, first 110 frames each), AbsRel / delta10.0549 / 0.98020.0549 / 0.98020.0550 / 0.98020.0549 / 0.98020.0549 / 0.9802
video-depth-anything-sTUM RGB-D video (3 sequences, first 1000 frames each), AbsRel / delta10.1120 / 0.8716
video-depth-anything-metric-sTUM RGB-D video (3 sequences, first 110 frames each), AbsRel / delta10.0786 / 0.97690.0785 / 0.97690.0786 / 0.97690.0786 / 0.97690.0785 / 0.9769
video-depth-anything-metric-sTUM RGB-D video (3 sequences, first 1000 frames each), AbsRel / delta10.1214 / 0.8883

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks a49aaba7, 2026-11-12.

Parity

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).

variantkernels error vs original, mean / p99GPU, torchkernels used
video-depth-anything-s0.00042 / 0.00105RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120
video-depth-anything-metric-s0.00273 / 0.00361RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120

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.

Example output

No example rendered for this checkpoint yet.