/ Модель

Характеристики

Лицензия
MIT
Архитектура
dpt · dense
Опубликована
28 ноя 2023

dpt-beit-large-512

Оценка глубиныИзображение → depth_map3 профессии

Модель Intel на основе BEiT и DPT оценивает относительную глубину сцены по одному изображению.

257скачиваний за 30 дней9лайковвеса обновлены21 июн 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Intel/dpt-beit-large-512 — модель для оценки относительной глубины по одному изображению. Она использует архитектуру Dense Prediction Transformer (DPT): BEiT Large служит визуальным энкодером, к которому добавлены дополнительные слои для предсказания карты глубины. Модель обучена на 1,4 млн изображений и предназначена для оценки глубины без дополнительной настройки; в карточке описан вариант с разрешением обучения 512×512.

Модель подходит для анализа сцены, создания карт глубины и использования в задачах 3D-реконструкции и автономного вождения. Она обрабатывает изображения и выдаёт карту глубины. Качество оценки зависит от изображения и обучающих данных; предсказания могут быть неточными, поэтому модель следует проверять перед применением. Разработчик — Intel. Лицензия — MIT.

Сценарии применения

  • оценка глубины по фотографии
  • создание карты глубины для сцены
  • подготовка изображения для 3D-реконструкции
  • оценка расстояний в кадре для автономного вождения

Ограничения

Оценка глубины по одному изображению неоднозначна и может быть неточной; качество зависит от сцены и данных обучения. Перед развёртыванием рекомендуется проверять результаты модели.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Overview of Monocular depth estimation and BEiT

Monocular depth estimation, aiming to infer detailed depth from a single image or camera view, finds applications in fields like generative AI, 3D reconstruction, and autonomous driving. However, deriving depth from individual pixels in a single image is challenging due to the underconstrained nature of the problem. Recent advancements attribute progress to learning-based methods, particularly with MiDaS, leveraging dataset mixing and scale-and-shift-invariant loss. MiDaS has evolved with releases featuring more powerful backbones and lightweight variants for mobile use. With the rise of transformer architectures in computer vision, including those pioneered by models like ViT, there's been a shift towards using them for depth estimation. Inspired by this, MiDaS v3.1 incorporates promising transformer-based encoders alongside traditional convolutional ones, aiming for a comprehensive investigation of depth estimation techniques. The paper focuses on describing the integration of these backbones into MiDaS, providing a thorough comparison of different v3.1 models, and offering guidance on utilizing future backbones with MiDaS.

Input ImageOutput Depth Image
input imageDepth image

Model description

This DPT model uses the BEiT model as backbone and adds a neck + head on top for monocular depth estimation. model image

The previous release MiDaS v3.0 solely leverages the vanilla vision transformer ViT, MiDaS v3.1 offers additional models based on BEiT, Swin, SwinV2, Next-ViT and LeViT.

DPT 3.1 (BEiT backbone)

The highest quality depth estimation is achieved using the BEiT transformer. We provide variants such as BEiT512-L, BEiT384-L, and BEiT384-B, where the numbers signify training resolutions of 512x512 and 384x384, while the letters denote large and base models respectively. Although newer versions like BEiT v2 and BEiT-3 exist, they were not explored in our study. BEiT v2 lacked pretrained checkpoints with resolutions of 384x384 or higher, only offering them at 224x224. BEiT-3 was released after our study was completed.

DPT (Dense Prediction Transformer) model trained on 1.4 million images for monocular depth estimation. It was introduced in the paper Vision Transformers for Dense Prediction by Ranftl et al. (2021) and first released in this repository.

This model card refers specifically to BEiT512-L in the paper, and is refered to dpt-beit-large-512. A more recent paper from 2013, specifically discussing BEit, is in this paper MiDaS v3.1 – A Model Zoo for Robust Monocular Relative Depth Estimation

The model card has been written in combination by the Hugging Face team and Intel.

Model DetailDescription
Model Authors - CompanyIntel
DateMarch 7, 2024
Version1
TypeComputer Vision - Monocular Depth Estimation
Paper or Other ResourcesMiDaS v3.1 – A Model Zoo for Robust Monocular Relative Depth Estimation and GitHub Repo
LicenseMIT
Questions or CommentsCommunity Tab and Intel Developers Discord
Intended UseDescription
Primary intended usesYou can use the raw model for zero-shot monocular depth estimation. See the model hub to look for fine-tuned versions on a task that interests you.
Primary intended usersAnyone doing monocular depth estimation
Out-of-scope usesThis model in most cases will need to be fine-tuned for your particular task. The model should not be used to intentionally create hostile or alienating environments for people.

How to use

Be sure the to update PyTorch as Transformers as mismatches in versions can generate erros such as: "TypeError: unsupported operand type(s) for //: 'NoneType' and 'NoneType'".

As tested by this contributor, the following versions ran correctly:

import torch
import transformers
print(torch.__version__)
print(transformers.__version__)
out: '2.2.1+cpu'
out: '4.37.2'

To Install:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
 

To Use:

Here is how to use this model for zero-shot depth estimation on an image:

from transformers import DPTImageProcessor, DPTForDepthEstimation
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 = DPTImageProcessor.from_pretrained("Intel/dpt-beit-large-512")
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-beit-large-512")

# prepare image for the model
inputs = processor(images=image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)
    predicted_depth = outputs.predicted_depth

# interpolate to original size
prediction = torch.nn.functional.interpolate(
    predicted_depth.unsqueeze(1),
    size=image.size[::-1],
    mode="bicubic",
    align_corners=False,
)

# visualize the prediction
output = prediction.squeeze().cpu().numpy()
formatted = (output * 255 / np.max(output)).astype("uint8")
depth = Image.fromarray(formatted)
depth

or one can use the pipeline API:

from transformers import pipeline

pipe = pipeline(task="depth-estimation", model="Intel/dpt-beit-large-512")
result = pipe("http://images.cocodataset.org/val2017/000000181816.jpg")
result["depth"]

Quantitative Analyses

ModelSquare Resolution HRWSI RMSESquare Resolution Blended MVS RELSquare Resolution ReDWeb RMSE
BEiT 384-L0.0680.0700.076
Swin-L Training 10.07080.07240.0826
Swin-L Training 20.07130.07200.0831
ViT-L0.0710.0720.082
------------
Next-ViT-L-1K-6M0.0750.0730.085
DeiT3-L-22K-1K0.0700.0700.080
ViT-L-Hybrid0.0750.0750.085
DeiT3-L0.0770.0750.087
------------
ConvNeXt-XL0.0750.0750.085
ConvNeXt-L0.0760.0760.087
EfficientNet-L20.1650.2770.219
------------
ViT-L Reversed0.0710.0730.081
Swin-L Equidistant0.0720.0740.083
------------

Ethical Considerations and Limitations

dpt-beit-large-512 can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.

Therefore, before deploying any applications of dpt-beit-large-512, developers should perform safety testing.

Caveats and Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.

Here are a couple of useful links to learn more about Intel's AI software:

  • Intel Neural Compressor link
  • Intel Extension for Transformers link

Disclaimer

The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please cosult an attorney before using this model for commercial purposes.

BibTeX entry and citation info

@article{DBLP:journals/corr/abs-2103-13413,
  author    = {Ren{\'{e}} Reiner Birkl, Diana Wofk, Matthias Muller},
  title     = {MiDaS v3.1 – A Model Zoo for Robust Monocular Relative Depth Estimation},
  journal   = {CoRR},
  volume    = {abs/2307.14460},
  year      = {2021},
  url       = {https://arxiv.org/abs/2307.14460},
  eprinttype = {arXiv},
  eprint    = {2307.14460},
  timestamp = {Wed, 26 Jul 2023},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2307.14460.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · depth-estimation

Можно запустить

Подбираем GPU…

Класс архитектуры
DPTForDepthEstimation
Ревизия весов
2071eb5

0 моделей