/ Модель

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

Лицензия
Apache 2.0
Архитектура
depth_anything_v2 · dense
Базовая модель
Depth-Anything-V2-Metric-Hypersim-Base
Библиотека
transformers
Опубликована
27 окт 2026

Depth-Anything-V2-Metric-Hypersim-Base

Оценка глубиныИзображение → depth_map3 профессии
31скачиваний за 30 дней0лайковвеса обновлены27 окт 2026

Описание модели

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

Перенос Depth Anything V2 Metric Hypersim Base в формат Transformers оценивает метрическую глубину сцены по изображению в диапазоне до 20 метров.

Это неофициальный перенос в формат Transformers модели Depth Anything V2 Metric Hypersim Base. Исходную модель разработала команда Lihe Yang, Bingyi Kang, Zilong Huang, Zhen Zhao, Xiaogang Xu, Jiashi Feng и Hengshuang Zhao; данный репозиторий преобразует её веса из .pth в safetensors и сохраняет исходную реализацию модели для работы через Transformers.

Модель предназначена для оценки метрической глубины по изображению. В архитектуре используются DINOv2 ViT-B/14 как извлекатель признаков и DPT как голова глубины; выходной диапазон ограничен 20 метрами. Обучение проводилось на Hypersim. Модель принимает изображения и возвращает карту глубины; README сообщает о побитном совпадении результатов с официальным кодом на проверенных примерах, включая изображения неквадратной формы.

Для загрузки используется Transformers с trust_remote_code. Код и веса распространяются по лицензии Apache-2.0. Это базовая модель для оценки глубины, специализированная на метрической глубине в сценах, соответствующих обучающим данным Hypersim.

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

  • оценка глубины на изображениях интерьеров
  • построение метрической карты глубины для компьютерного зрения
  • получение глубины для неквадратных изображений
  • извлечение признаков DINOv2 для последующей обработки карты глубины

Ограничения

Диапазон предсказаний ограничен 20 метрами, а обучение проводилось на Hypersim, поэтому качество на других типах сцен может отличаться. Для загрузки требуется trust_remote_code.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

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

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

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

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

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

Открыть на Hugging Face

Depth-Anything-V2-Metric-Hypersim-Base — transformers format (original code)

Unofficial transformers port of Depth Anything V2 Metric Hypersim Base (depth-anything/Depth-Anything-V2-Metric-Hypersim-Base, depth_anything_v2_metric_hypersim_vitb.pth) that runs the original code. Loads with trust_remote_code. model.safetensors holds the checkpoint's tensors under their original names, converted from .pth (every tensor checked equal).

Not an official release. Depth Anything V2 was created by Lihe Yang, Bingyi Kang, Zilong Huang, Zhen Zhao, Xiaogang Xu, Jiashi Feng and Hengshuang Zhao — https://github.com/DepthAnything/Depth-Anything-V2, paper "Depth Anything V2" (arXiv 2406.09414).

What it is

DepthAnythingV2ForDepthEstimation holds the official DepthAnythingV2's submodules (pretrained: DINOv2 ViT-B/14, depth_head: DPT) and computes depth with that class's own forward — the metric-depth class of metric_depth/ (head Sigmoid() × max_depth = 20 m, trained on Hypersim), returning the standard DepthEstimatorOutput (predicted_depth); the official infer_image and image2tensor are kept. Code vendored from DepthAnything/Depth-Anything-V2 @ a561b849 into dav2_dinov2.py / dav2_dpt.py (relative depth) and dav2_metric_dinov2.py / dav2_metric_dpt.py (metric_depth/); edits: imports, and Block → NestedTensorBlock where the original imported NestedTensorBlock as Block. DepthAnythingV2Processor (processing_depth_anything_v2.py, processor_config.json) wraps DepthAnythingV2ImageProcessor, the image2tensor transform.

transformers' own DepthAnythingForDepthEstimation (the -hf repos) is a re-implementation: on the same input it matches the original only for square inputs; for non-square inputs its DINOv2 position-embedding interpolation differs (0.8–1.9 % max relative depth difference measured on Small). This package runs the original modules instead.

Verified against the official code (same process, V100, 3 images incl. non-square): preprocessing, predicted_depth (also as a tuple), the hidden states, infer_image, the processor's post-processing and fp16 autocast outputs are bit-identical.

Usage

import torch
from PIL import Image
from transformers import AutoModelForDepthEstimation, AutoProcessor

model = AutoModelForDepthEstimation.from_pretrained("Depth-Anything-V2-Metric-Hypersim-Base", trust_remote_code=True).eval().cuda()
processor = AutoProcessor.from_pretrained("Depth-Anything-V2-Metric-Hypersim-Base", trust_remote_code=True)
image = Image.open("image.jpg")                                   # or a path (read with cv2, as the original scripts)
inputs = processor(images=image, return_tensors="pt").to("cuda")
with torch.no_grad():
    outputs = model(**inputs)                                     # outputs.predicted_depth: (1, H', W') metric depth in meters (max 20)
depth = processor.post_process_depth_estimation(outputs, target_sizes=[image.size[::-1]])[0]["predicted_depth"]
# or, exactly as the original scripts: model.infer_image(cv2.imread("image.jpg"))
  • AutoModel loads the same class. output_hidden_states=True adds the DINOv2 features the DPT head reads; return_dict=False returns a tuple.
  • post_process_depth_estimation resizes as the original infer_image (bilinear, align_corners=True), not with transformers' bicubic.

Runtime packages beyond torch / transformers: opencv-python, torchvision (as the original).

Licensing

  • Code and weights: Apache-2.0 — LICENSE (DepthAnything/Depth-Anything-V2), as published on depth-anything/Depth-Anything-V2-Metric-Hypersim-Base.
  • Attribution, sources and the changes made here: NOTICE.

Citation

If you use this model, please cite the original work, as its authors ask:

@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}
}

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

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

GPU в ailist

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

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
DepthAnythingV2ForDepthEstimation
Ревизия весов
f07c04b

0 моделей