🚀 深度任意模型V2-Large
深度任意模型V2是一個單目深度估計(MDE)模型,它基於59.5萬張合成標註圖像和6200萬張以上的真實未標註圖像進行訓練。該模型具有高精度、強魯棒性、高效率等特點,能夠為圖像深度估計任務提供強大的支持。
🚀 快速開始
深度任意模型V2是基於59.5萬張合成標註圖像和6200萬張以上的真實未標註圖像訓練得到的單目深度估計(MDE)模型。它具有比深度任意模型V1更精細的細節、更強的魯棒性,比基於穩定擴散(SD)的模型更高效、更輕量級,並且使用預訓練模型進行微調能取得出色的性能。
✨ 主要特性
- 相較於深度任意模型V1,具有更精細的細節。
- 比深度任意模型V1和基於穩定擴散(SD)的模型(如Marigold、Geowizard)更具魯棒性。
- 比基於穩定擴散(SD)的模型更高效(快10倍)、更輕量級。
- 使用預訓練模型進行微調,能取得出色的性能。
📦 安裝指南
git clone https://huggingface.co/spaces/depth-anything/Depth-Anything-V2
cd Depth-Anything-V2
pip install -r requirements.txt
💻 使用示例
基礎用法
首先,下載模型並將其放置在checkpoints
目錄下。
import cv2
import torch
from depth_anything_v2.dpt import DepthAnythingV2
model = DepthAnythingV2(encoder='vitl', features=256, out_channels=[256, 512, 1024, 1024])
model.load_state_dict(torch.load('checkpoints/depth_anything_v2_vitl.pth', map_location='cpu'))
model.eval()
raw_img = cv2.imread('your/image/path')
depth = model.infer_image(raw_img)
📄 許可證
本項目採用CC BY-NC 4.0許可證。
📚 引用說明
如果您覺得本項目有用,請考慮引用以下文獻:
@article{depth_anything_v2,
title={Depth Anything V2},
author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Zhao, Zhen and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
journal={arXiv:2406.09414},
year={2024}
}
@inproceedings{depth_anything_v1,
title={Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data},
author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
booktitle={CVPR},
year={2024}
}