Metric Video Depth Anything Small (MLX)

MLX port of Video Depth Anything (ByteDance, CVPR 2025 highlight): consistent monocular depth estimation for arbitrarily long videos. Converted from the official checkpoint depth-anything/Metric-Video-Depth-Anything-Small.

Architecture: DINOv2 backbone + DPT head with AnimateDiff-style temporal motion modules. Outputs per-frame depth maps, not text.

Usage

from mlx_vlm import load
from mlx_vlm.models.video_depth_anything.generate import (
    VideoDepthPredictor,
    read_video_frames,
)

model, processor = load("mlx-community/Metric-Video-Depth-Anything-Small-MLX")
predictor = VideoDepthPredictor(model, processor)

frames, fps = read_video_frames("input.mp4", max_len=300, target_fps=15)
depths = predictor.infer(frames)  # (T, H, W) float32

Notes

  • Inputs are channel-last (B, T, H, W, 3); H and W must be multiples of 14.
  • Metric model: yes. Metric models output absolute depth (meters) and skip scale/shift window alignment.
  • Weights are fp32. On GPU, output matches the PyTorch reference to ~1% relative (Metal fast-math); on CPU to ~1e-5.

License

CC-BY-NC-4.0 (same as the source checkpoint). Non-commercial use only.

Downloads last month
54
Safetensors
Model size
29.1M params
Tensor type
F32
ยท
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support