🚀 GLPN在KITTI數據集上的微調模型
本項目是基於KITTI數據集進行單目深度估計而訓練的Global-Local Path Networks (GLPN) 模型。該模型由Kim等人在論文 Global-Local Path Networks for Monocular Depth Estimation with Vertical CutDepth 中提出,並首次在 此倉庫 發佈。
⚠️ 重要提示
GLPN模型的發佈團隊並未為此模型編寫模型卡片,此卡片由Hugging Face團隊編寫。
✨ 主要特性
- GLPN模型以SegFormer為骨幹網絡,並在其基礎上添加了一個輕量級頭部用於深度估計。

🚀 快速開始
你可以使用該原始模型進行單目深度估計。你可以在 模型中心 查找針對你感興趣的任務進行微調的版本。
💻 使用示例
基礎用法
from transformers import GLPNImageProcessor, GLPNForDepthEstimation
import torch
import numpy as np
from PIL import Image
import requests
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
processor = GLPNImageProcessor.from_pretrained("vinvino02/glpn-kitti")
model = GLPNForDepthEstimation.from_pretrained("vinvino02/glpn-kitti")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
predicted_depth = outputs.predicted_depth
prediction = torch.nn.functional.interpolate(
predicted_depth.unsqueeze(1),
size=image.size[::-1],
mode="bicubic",
align_corners=False,
)
output = prediction.squeeze().cpu().numpy()
formatted = (output * 255 / np.max(output)).astype("uint8")
depth = Image.fromarray(formatted)
更多代碼示例,請參考 文檔。
📚 詳細文檔
BibTeX引用和引用信息
@article{DBLP:journals/corr/abs-2201-07436,
author = {Doyeon Kim and
Woonghyun Ga and
Pyunghwan Ahn and
Donggyu Joo and
Sehwan Chun and
Junmo Kim},
title = {Global-Local Path Networks for Monocular Depth Estimation with Vertical
CutDepth},
journal = {CoRR},
volume = {abs/2201.07436},
year = {2022},
url = {https://arxiv.org/abs/2201.07436},
eprinttype = {arXiv},
eprint = {2201.07436},
timestamp = {Fri, 21 Jan 2022 13:57:15 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-2201-07436.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
📄 許可證
本項目採用Apache-2.0許可證。
屬性 |
詳情 |
模型類型 |
用於單目深度估計的GLPN模型 |
訓練數據 |
KITTI數據集 |