🚀 Prompt-Depth-Anything-Vits
Prompt-Depth-Anything-Vits 是一种高分辨率且精确的度量深度估计方法,可利用提示技术挖掘深度基础模型的潜力,为 3D 重建和机器人抓取等下游应用提供支持。
🚀 快速开始
Prompt Depth Anything 是一种高分辨率且精确的度量深度估计方法,具有以下亮点:
- 受视觉语言模型(VLM)和大语言模型(LLM)中提示技术成功应用的启发,使用提示技术挖掘深度基础模型的潜力。
- 以广泛使用的 iPhone LiDAR 作为提示,引导模型生成高达 4K 分辨率的精确度量深度。
- 引入了可扩展的数据管道来训练该方法。
- Prompt Depth Anything 有利于下游应用,包括 3D 重建和通用机器人抓取。
✨ 主要特性
- 提示驱动:借助提示技术激发深度基础模型的潜力。
- 高分辨率输出:以 iPhone LiDAR 为提示,生成高达 4K 分辨率的精确度量深度。
- 可扩展训练:采用可扩展的数据管道进行模型训练。
- 应用广泛:对 3D 重建和机器人抓取等下游应用有帮助。
💻 使用示例
基础用法
import requests
from PIL import Image
from transformers import PromptDepthAnythingForDepthEstimation, PromptDepthAnythingImageProcessor
url = "https://github.com/DepthAnything/PromptDA/blob/main/assets/example_images/image.jpg?raw=true"
image = Image.open(requests.get(url, stream=True).raw)
image_processor = PromptDepthAnythingImageProcessor.from_pretrained("depth-anything/prompt-depth-anything-vits-hf")
model = PromptDepthAnythingForDepthEstimation.from_pretrained("depth-anything/prompt-depth-anything-vits-hf")
prompt_depth_url = "https://github.com/DepthAnything/PromptDA/blob/main/assets/example_images/arkit_depth.png?raw=true"
prompt_depth = Image.open(requests.get(prompt_depth_url, stream=True).raw)
inputs = image_processor(images=image, return_tensors="pt", prompt_depth=prompt_depth)
with torch.no_grad():
outputs = model(**inputs)
post_processed_output = image_processor.post_process_depth_estimation(
outputs,
target_sizes=[(image.height, image.width)],
)
predicted_depth = post_processed_output[0]["predicted_depth"]
📄 许可证
本项目采用 Apache-2.0 许可证。
📚 详细文档
引用
如果您觉得这个项目有用,请考虑引用以下文献:
@inproceedings{lin2024promptda,
title={Prompting Depth Anything for 4K Resolution Accurate Metric Depth Estimation},
author={Lin, Haotong and Peng, Sida and Chen, Jingxiao and Peng, Songyou and Sun, Jiaming and Liu, Minghuan and Bao, Hujun and Feng, Jiashi and Zhou, Xiaowei and Kang, Bingyi},
journal={arXiv},
year={2024}
}