> This is the documentation for LibreYOLO 1.5.0. Current version: https://www.libreyolo.com/docs/models/depth-anything-3

# Depth Anything 3
Depth Anything 3 is a plain DINOv2 transformer trained to predict depth and camera geometry from one or more views with no architectural specialization. LibreYOLO ports its DA3MONO-LARGE checkpoint for the depth task: predict and zero-shot validation, with no training path.
Tasks: depth. Install: pip install libreyolo.
Verified against LibreYOLO v1.5.0.

## Install

Depth Anything 3 needs no optional extra. Everything it imports is in the base
install.

```bash
pip install libreyolo
```

## Predict

Weights download from Hugging Face on first use and are cached locally.

**Python**

```python
from libreyolo import LibreYOLO, SAMPLE_IMAGE

model = LibreYOLO("LibreDepthAnything3l-depth.pt")
result = model(SAMPLE_IMAGE, save=True)

depth = result.depth_map
print(depth.min, depth.max, depth.mean)
```

**CLI**

```bash
libreyolo predict model=LibreDepthAnything3l-depth.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True
```

**Read the depth map**

```python
from libreyolo import LibreYOLO, SAMPLE_IMAGE

model = LibreYOLO("LibreDepthAnything3l-depth.pt")
result = model(SAMPLE_IMAGE)

depth = result.depth_map    # DepthMap: dense (H, W), higher = closer
raw = depth.data                # tensor, no metric unit or cross-image scale
normalized = depth.normalized() # rescaled to [0, 1] for visualization
```

`result.depth_map` carries a dense relative inverse-depth map: higher
values mean closer to the camera, and the values have no metric unit or
cross-image scale. The upstream checkpoint emits positive relative depth;
LibreYOLO's network wrapper inverts it and reproduces the official sky
handling so the output follows LibreYOLO's shared depth contract. `save=True`
writes a colormapped visualization of that map to disk; `Results.plot()` does
not cover this family, since it is defined for surface normals and edges only.
See [prediction](/docs/v1.5.0/predict) for sources, streaming and result handling.

## Variants

One size, `l`, at a fixed input resolution. Upstream DA3 also publishes Small
and Base any-view checkpoints, a metric-depth checkpoint, and Nested and Giant
checkpoints; LibreYOLO exposes none of them. Metric depth needs a different
public contract than LibreYOLO's relative-inverse-depth task, and the any-view
and Nested checkpoints need a multi-image camera API LibreYOLO does not offer.
The Large and Giant any-view checkpoints are also CC-BY-NC-4.0 and are not
referenced by any LibreYOLO download path.

Training is not offered for this family. `LibreDepthAnything3.train()` raises
`NotImplementedError` unconditionally; train upstream and convert a compatible
DA3MONO-LARGE checkpoint with `weights/convert_depth_anything3_weights.py`.

## Validate

`val()` runs the shared depth validator: it aligns each prediction to its
ground truth with a per-image least-squares scale and shift, then reports the
standard zero-shot relative-depth metrics, AbsRel, RMSE and the three delta
thresholds.

**Python**

```python
from libreyolo import LibreYOLO

model = LibreYOLO("LibreDepthAnything3l-depth.pt")
metrics = model.val(data="my-dataset.yaml")

print(metrics["metrics/abs_rel"])
print(metrics["metrics/rmse"])
print(metrics["metrics/delta1"])
```

**CLI**

```bash
libreyolo val model=LibreDepthAnything3l-depth.pt data=my-dataset.yaml
```

## Export

| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| depth | yes | yes | yes | yes | yes |  |  |  |  |  |  |  |

A "yes" means the export is supported. An empty cell means the exporter refuses that combination.

Export is restricted to five formats for this family: ONNX, TorchScript,
ExecuTorch, TensorRT and OpenVINO. Requesting any other format raises
`NotImplementedError` rather than attempting an unvalidated conversion. An
exported artifact loads back through `LibreYOLO()` on its file suffix, so a
`.onnx` or `.engine` file behaves like a checkpoint and returns the same
`Results`, with `depth_map` in place of boxes.

**Python**

```python
from libreyolo import LibreYOLO

model = LibreYOLO("LibreDepthAnything3l-depth.pt")
model.export(format="onnx")
model.export(format="tensorrt", half=True)
```

**CLI**

```bash
libreyolo export model=LibreDepthAnything3l-depth.pt format=onnx
libreyolo export model=LibreDepthAnything3l-depth.pt format=tensorrt half=True
```

**Use the exported file**

```python
from libreyolo import LibreYOLO, SAMPLE_IMAGE

# The factory routes on the file suffix, so an exported artifact loads
# like any checkpoint and returns the same Results object.
model = LibreYOLO("LibreDepthAnything3l-depth.onnx")
result = model(SAMPLE_IMAGE)

print(result.depth_map.data.shape)
```

## Checkpoints

Every published weight file for this family.

| File | Input (px) | Task | Weights license |
| --- | --- | --- | --- |
| `LibreDepthAnything3l-depth.pt` |  | depth | apache-2.0 |

## Licensing

Check the license on the Hugging Face repository of the specific weights you download. That repository is authoritative and licenses are not always uniform across a family. This is a description of the licenses involved, not legal advice.

- Original work: Depth Anything 3, ByteDance Seed
- Upstream license: Apache-2.0
- Upstream source: https://github.com/ByteDance-Seed/Depth-Anything-3
- LibreYOLO code: Apache-2.0
- Weights: Apache-2.0, republished at https://huggingface.co/LibreYOLO
- Interpretation: Apache-2.0 is a permissive license, so the DA3MONO-LARGE checkpoint LibreYOLO ports can be used in commercial and closed-source products. It asks you to keep its license text and attribution notices with any copy you redistribute, and it grants a patent license. It places no obligation on your own application code. The upstream project also publishes CC-BY-NC-4.0 Large, Giant and Nested checkpoints for its any-view and multi-view modes; LibreYOLO does not port those, so that non-commercial license never reaches anything this family downloads.

## Citation

```bibtex
@article{depthanything3,
  title={Depth Anything 3: Recovering the visual space from any views},
  author={Haotong Lin and Sili Chen and Jun Hao Liew and Donny Y. Chen and Zhenyu Li and Guang Shi and Jiashi Feng and Bingyi Kang},
  journal={arXiv preprint arXiv:2511.10647},
  year={2025}
}
```

Copied from https://github.com/ByteDance-Seed/Depth-Anything-3#-citations


## Depth Anything 3 architecture

- Large monocular: [SVG](/diagrams/models/depth-anything-3/l-depth.svg), [interactive diagram](/diagrams/models/depth-anything-3/l-depth.html)
