depth-anything.cpp

A C++ port of the Depth Anything 2 and 3 depth estimation models, built on ggml. It lets you run monocular depth estimation locally without a heavy Python stack.

Share on XLicense: MIT

Overview

depth-anything.cpp is a from-scratch C++17 port of Depth Anything 2 and 3 from ByteDance, built on ggml, from the LocalAI team. From an image it recovers metric depth, per-pixel confidence, camera extrinsics and intrinsics, an optional sky mask and a 3D point cloud, and it can export glb, COLMAP and PLY. Everything is stored in a single GGUF file, and inference needs no Python, PyTorch or CUDA toolkit, only a small native library and CLI.

Key features

  • Monocular metric depth and camera pose from a single image
  • Small, base, large and giant model sizes in one GGUF format
  • Quantization down to q4_k at 99 MB
  • CPU-first with CUDA, Metal and Vulkan backends
  • Flat C API for embedding from C, C++, Go or Rust

Best for

Developers who want Depth Anything inference in a native library without a Python stack. Output is stated to match the PyTorch reference numerically.

Upstream
localai-org/depth-anything.cpp
Fork on GitHub
Guo-astro/depth-anything.cpp
Upstream stars
1.1k
Category
Finance, data and research
Language
C++
License
MIT
Forked
2026-08-02
Sync status
In syncLast synced 2026-09-29