Depth Anything 3
Depth Anything 3 就是一个普通的 DINOv2 transformer,训练目标是从一个或多个视角预测深度和相机几何,没有任何架构上的特化。LibreYOLO 为深度任务移植了它的 DA3MONO-LARGE 检查点:支持预测和零样本(zero-shot)验证,没有训练路径。
- 任务
- depth
- 尺寸
- l at 504 px
- 安装
pip install libreyolo- 支持层级
- 仅推理,自 v 起。仅支持预测、验证和导出。训练相关的功能不适用。
- 许可
- 代码采用 Apache-2.0,权重采用 Apache-2.0。商用
安装
Depth Anything 3 不需要任何可选 extra。它导入的一切都在基础安装里。
pip install libreyolo预测
权重在首次使用时从 Hugging Face 下载,并缓存在本地。
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreDepthAnything3l-depth.pt")result = model(SAMPLE_IMAGE, save=True) depth = result.depth_mapprint(depth.min, depth.max, depth.mean)libreyolo predict model=LibreDepthAnything3l-depth.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=Truefrom libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreDepthAnything3l-depth.pt")result = model(SAMPLE_IMAGE) depth = result.depth_map # DepthMap:稠密的 (H, W),数值越大越近raw = depth.data # 张量,没有度量单位,也没有跨图像的尺度normalized = depth.normalized() # 重新缩放到 [0, 1] 以便可视化result.depth_map 装的是一张稠密的相对逆深度图:数值越大表示离相机越近,而且这些
数值没有度量单位,也没有跨图像的尺度。上游检查点(checkpoint)输出的是正的相对
深度;LibreYOLO 的网络包装器把它取逆,并复现了官方的天空处理,让输出符合
LibreYOLO 共享的深度契约。save=True 会把这张图经过色彩映射的可视化结果写入
磁盘;Results.plot() 不覆盖这个家族,因为它只为表面法线和边缘定义。数据源、
流式处理和结果处理见预测。
变体
只有一种尺寸 l,输入分辨率固定。上游 DA3 还发布了 Small 和 Base 的 any-view
检查点、一个度量深度(metric depth)检查点,以及 Nested 和 Giant 检查点;
LibreYOLO 一个都没有对外提供。度量深度需要一套不同于 LibreYOLO 相对逆深度任务的
公开契约,而 any-view 和 Nested 检查点需要一套 LibreYOLO 并不提供的多图像相机
API。Large 和 Giant 的 any-view 检查点还采用 CC-BY-NC-4.0 许可,任何 LibreYOLO
下载路径都没有引用它们。
这个家族不提供训练。LibreDepthAnything3.train() 无条件抛出
NotImplementedError;请在上游训练,再用
weights/convert_depth_anything3_weights.py 转换一个兼容的 DA3MONO-LARGE
检查点。
验证
val() 运行共用的深度验证器:它用逐图像的最小二乘尺度和偏移把每个预测对齐到它的
真值(ground truth),然后报告标准的零样本相对深度指标,即 AbsRel、RMSE 和三个
delta 阈值。
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"])libreyolo val model=LibreDepthAnything3l-depth.pt data=my-dataset.yaml导出
| 任务 | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| depth | depth to ONNX:支持 | depth to TorchScript:支持 | depth to ExecuTorch:支持 | depth to TensorRT:支持 | depth to OpenVINO:支持 | depth to Paddle:不支持 | depth to MNN:不支持 | depth to RKNN:不支持 | depth to ncnn:不支持 | depth to TFLite:不支持 | depth to CoreML:不支持 | depth to Core AI:不支持 |
这个家族的导出限定在五种格式:ONNX、TorchScript、ExecuTorch、TensorRT 和
OpenVINO。请求其他任何格式都会抛出 NotImplementedError,而不是去尝试一次未经
验证的转换。导出的产物按文件后缀经由 LibreYOLO() 重新加载,所以一个 .onnx 或
.engine 文件的表现和检查点一样,返回同样的 Results,只是用 depth_map 取代
检测框。
from libreyolo import LibreYOLO model = LibreYOLO("LibreDepthAnything3l-depth.pt")model.export(format="onnx")model.export(format="tensorrt", half=True)libreyolo export model=LibreDepthAnything3l-depth.pt format=onnxlibreyolo export model=LibreDepthAnything3l-depth.pt format=tensorrt half=Truefrom libreyolo import LibreYOLO, SAMPLE_IMAGE # 工厂按文件后缀分发,所以导出的产物加载方式和任何检查点一样,# 返回的也是同一个 Results 对象model = LibreYOLO("LibreDepthAnything3l-depth.onnx")result = model(SAMPLE_IMAGE) print(result.depth_map.data.shape)检查点
这个家族已发布的全部权重文件。
| 文件 | 输入(px) | 权重许可 |
|---|---|---|
| depth | ||
| LibreDepthAnything3l-depth.pt | apache-2.0 | |
上面的每个文件目前都在 LibreYOLO 组织中,并会在首次使用时下载。
许可证
请检查你所下载的具体权重在 Hugging Face 仓库中的许可。LibreYOLO 组织里的每个检查点都附有许可,同一家族内也不一定相同。该仓库是权威来源;以下摘要说明本页上次验证时适用的情况。
这里只说明涉及的许可证,不构成法律意见。如果答案对商用很重要,请自行阅读许可证并咨询法律顾问。
- 原始工作
- Depth Anything 3, ByteDance Seed
- 上游许可
- Apache-2.0
- LibreYOLO 代码
- MIT
- 权重
- 采用 Apache-2.0 许可,重新发布在 huggingface.co/LibreYOLO
- 解读
- 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.
引用
@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}
}复制自作者在 github.com/ByteDance-Seed/Depth-Anything-3#-citations 上提供的引用块。