Depth Anything V3 Mono Large - ONNX
Performance-optimized ONNX build of Depth Anything V3 Mono Large - the monocular-specialized member of the Depth Anything V3 family - for real-time stereo and disparity workflows. The output is a ready-to-use disparity map (near = bright, far = dark, skies correctly at far) matching Depth Anything V2's convention - no postprocessing required. Each build serves five input resolutions (1036², 728², 518², 364², 252²).
See it in action: Oku3D Media Player uses this model to convert any 2D video or photo into immersive 3D for autostereoscopic and lenticular displays - "Watch everything in 3D."
Key Features
- Sky-aware inverse disparity: computes true inverse disparity
1/(depth + 0.2)and composites the model's own sky-segmentation head into the graph, so skies and far backgrounds separate cleanly from foreground silhouettes - baked directly into a single ONNX output, no runtime postprocessing needed. - Disparity-ready output: near = high / far = low. Drop-in replacement for Depth Anything V2 in stereo / disparity pipelines without any postprocessing changes.
- Single-output ONNX: the upstream model emits a multi-tensor dict (depth, confidence, sky, optional camera params); this build folds everything into one disparity tensor for clean integration.
- FP16 or 4-bit weights: two builds of the same model, see Files below.
- Five resolutions per file: 1036×1036, 728×728, 518×518, 364×364 and 252×252.
- Opset 21: modern ONNX operators for broader runtime optimization support.
- Aggressive graph optimization: operator fusion and constant folding for maximum inference speed.
Despite the ViT-L/14 backbone, DA3MONO-LARGE is Apache-2.0 - free for commercial use. And it is not just "DA3 in large": it's a distinct model specialized for monocular depth (the regular multi-view DA3 line is optimized for a different task and costs mono quality) with its own sky-segmentation head.
Technical Specifications
| Property | Value |
|---|---|
| Input shape | (1, 3, S, S) NCHW, S ∈ {1036, 728, 518, 364, 252} - exactly these, no other resolutions |
| Input dtype | float16 |
| Input range | ImageNet-normalized RGB (mean [0.485, 0.456, 0.406], std [0.229, 0.224, 0.225]) |
| Output shape | (1, 1, S, S) |
| Output dtype | float16 |
| Output range | [0, 5] disparity (higher = closer, sky/far = 0) |
| Symbolic dim names | height, width (pin them via ORT free-dimension overrides for best DirectML performance) |
| Batch size | fixed at 1 |
| Opset | 21 |
| Unsupported input size | returns a (1, 1, 1, 1) NaN tensor instead of a depth map |
Files
Two builds. Same five resolutions, same input and output convention - they differ only in how the weights are stored:
| File | Weights | Size |
|---|---|---|
da-v3-mono-large_fp16_opset21_optimized.onnx |
FP16 | 656 MB |
da-v3-mono-large_q4f16_opset21_optimized.onnx |
4-bit, FP16 activations | 336 MB |
In the q4f16 build the matrix multiplications that carry the model's weights are stored at 4 bits per value (block size 128); activations, the decoder convolutions and the position embeddings stay FP16. It needs roughly half the VRAM, and at the small resolutions it is also faster, because those are limited by memory bandwidth rather than by compute. Its output differs from the FP16 build by less than 0.8% of the disparity range at every resolution.
Requirements
- VRAM: see the table below - 0.4 GB at the low end, 1.7 GB at 1036
- ONNX Runtime: 1.19.0 or higher (1.22+ for the q4f16 build, which uses
MatMulNBits) - Python: 3.8 or higher
Quick Start
pip install onnxruntime-directml numpy opencv-python
import cv2
import numpy as np
import onnxruntime as ort
# One of the five supported input sizes: 1036, 728, 518, 364, 252.
SIZE = 518
# Load model. Pinning the symbolic dims is optional but recommended for
# DirectML: it lets the kernels specialize for the exact tensor sizes.
opts = ort.SessionOptions()
opts.add_free_dimension_override_by_name('height', SIZE)
opts.add_free_dimension_override_by_name('width', SIZE)
session = ort.InferenceSession(
'da-v3-mono-large_fp16_opset21_optimized.onnx', # or ..._q4f16_...
opts,
providers=['DmlExecutionProvider', 'CPUExecutionProvider'],
)
input_name = session.get_inputs()[0].name
output_name = session.get_outputs()[0].name
# Load & preprocess (ImageNet-normalized RGB, NCHW float16)
img = cv2.cvtColor(cv2.imread('examples/sample1/source.jpg'), cv2.COLOR_BGR2RGB)
img = cv2.resize(img, (SIZE, SIZE))
arr = img.astype(np.float32) / 255.0
arr = (arr - [0.485, 0.456, 0.406]) / [0.229, 0.224, 0.225]
arr = np.transpose(arr, (2, 0, 1))[np.newaxis].astype(np.float16)
# Inference
disparity = session.run([output_name], {input_name: arr})[0].squeeze().astype(np.float32)
# Clip extreme values and normalize to [0, 1]
disparity = np.clip(np.nan_to_num(disparity, nan=0.0), -1e3, 1e3)
disparity_norm = (disparity - disparity.min()) / max(disparity.max() - disparity.min(), 1e-6)
# Save 8-bit PNG (near = bright, far = dark - already disparity-ready)
cv2.imwrite('disparity.png', (disparity_norm * 255).round().astype(np.uint8))
# Or 16-bit TIFF for higher precision
cv2.imwrite(
'disparity.tif',
(disparity_norm * 65535).round().astype(np.uint16),
[cv2.IMWRITE_TIFF_COMPRESSION, cv2.IMWRITE_TIFF_COMPRESSION_DEFLATE],
)
Performance
Benchmarked on an AMD Radeon RX 7900 XTX using ONNX Runtime 1.23 with DirectML: batch size 1, free-dimension overrides pinned to the tested resolution.
| Resolution | fp16 | fp16 VRAM | q4f16 | q4f16 VRAM |
|---|---|---|---|---|
| 1036×1036 | 6.9 fps | 1.7 GB | 6.7 fps | 1.4 GB |
| 728×728 | 16.4 fps | 1.2 GB | 15.9 fps | 0.9 GB |
| 518×518 | 31.7 fps | 0.9 GB | 33.7 fps | 0.6 GB |
| 364×364 | 58.9 fps | 0.8 GB | 63.4 fps | 0.5 GB |
| 252×252 | 88.6 fps | 0.7 GB | 101.3 fps | 0.4 GB |
Comparison: Quality
Side-by-side plasma renders against the strongest variant of each earlier depth-model generation. Plasma convention is uniform (yellow = near, dark = far); every model in the table emits this convention natively. The four reference samples are deliberately shared with the sister repo Jens-Duttke/DepthPro-ONNX-HighPerf so cross-model comparisons are direct.
| Model | ![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|
| This Model - DA V3 Mono Large (1036, fp16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (1036, q4f16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (728, fp16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (728, q4f16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (518, fp16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (518, q4f16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (364, fp16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (364, q4f16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (252, fp16) | ![]() |
![]() |
![]() |
![]() |
| This Model - DA V3 Mono Large (252, q4f16) | ![]() |
![]() |
![]() |
![]() |
| DA V2 Large (518, q4f16) | ![]() |
![]() |
![]() |
![]() |
| DA V2 Base (518, fp16) | ![]() |
![]() |
![]() |
![]() |
| DA V2 Small (518, fp16) | ![]() |
![]() |
![]() |
![]() |
| DA V1 Base (518, q4f16) | ![]() |
![]() |
![]() |
![]() |
| MiDaS DPT-Hybrid (384, q4f16) | ![]() |
![]() |
![]() |
![]() |
Each resolution appears twice, once per build. The q4f16 renders are there to be checked rather than taken on trust - click any pair and compare them at full size. Every other model was run at its native input resolution with its own preprocessing.
License
This ONNX build is licensed under the Apache License 2.0; the underlying weights inherit the upstream Depth Anything V3 Mono Large license, which is also Apache 2.0. Commercial use, product integration, and service deployment are permitted. This repository is an independent ONNX redistribution and is not affiliated with or endorsed by the upstream Depth Anything 3 authors.
Acknowledgements
- Depth Anything 3 by ByteDance Seed - the upstream model and weights.
- The Oku3D Media Player - production consumer of this model.
- Downloads last month
- 27
Model tree for Jens-Duttke/Depth-Anything-3-MONO-ONNX
Base model
depth-anything/DA3MONO-LARGE






























































