/ Модель

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

Лицензия
Apache 2.0
Архитектура
depth_anything · dense
Базовая модель
Depth-Anything-V2-Small-hf
Библиотека
transformers
Опубликована
6 ноя 2026

Depth-Anything-V2-Tiny-hf

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

Компактная производная Depth Anything V2 Small оценивает относительную глубину сцены по одному изображению.

112скачиваний за 30 дней0лайковвеса обновлены6 ноя 2026

Бенчмарки

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

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

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

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

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

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

Depth Anything V2 Tiny — созданная сообществом компактная модель для оценки плотной карты относительной глубины по одному изображению. Это не официальный вариант Depth Anything. Модель основана на Depth Anything V2 Small и использует DINOv2 ViT-S/14 с 8 слоями и DPT-подобный декодер. Веса содержат около 16,5 млн параметров и распространяются в формате safetensors; лицензия — Apache-2.0.

Модель предназначена для сценариев, где важны компактность и оценка глубины в изображениях, например для прототипирования и приложений с ограниченными ресурсами. На тесте NYUv2 Eigen она показала δ1 88,73% при разрешении 518×686 и 89,36% при 336×448. Результат — относительная глубина с неизвестными масштабом и смещением, а не метрическое расстояние.

Оценка проводилась на внутренних сценах NYUv2; качество на уличных, ночных, дождливых, снежных и промышленных сценах не проверялось. Тонкие структуры и мелкие объекты могут восстанавливаться хуже; качество на видео и временная стабильность не измерялись. Модель не предназначена для критичных с точки зрения безопасности решений без независимой проверки.

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

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

Ограничения

Выдаёт относительную глубину без метрического масштаба; оценка заявлена для внутренних сцен NYUv2, а качество на внешних и сложных условиях не проверялось. Тонкие структуры, мелкие объекты и временная стабильность на видео отдельно не оценивались.

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

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

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

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

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

Открыть на Hugging Face

Depth Anything V2 Tiny

A 16.5M-parameter, 8-layer community variant of Depth Anything V2 Small.

Depth Anything V2 Tiny is a structured-pruned and distilled version of Depth Anything V2 Small. It keeps the same DINOv2 ViT-S/14 backbone family and DPT-style decoder, but reduces the backbone from 12 to 8 transformer layers and the expensive reassemble branch from 384 to 192 channels. The result is 16,504,129 parameters (33.4% fewer than Small) and a 66.04 MB fp32 safetensors checkpoint, while retaining 85%+ δ1 on the NYUv2 Eigen test set at five deployment resolutions.

This is a community model. It is not an official Depth Anything release, and "Tiny" is not an official size in the Depth Anything V2 family.

Model at a glance

PropertyValue
Base modelDepth Anything V2 Small
Parameters16,504,129
BackboneDINOv2 ViT-S/14, 8 layers, 6 heads, hidden 384, patch 14
DecoderDPT-style neck; reassemble [48, 96, 192, 192]; fusion 64; head 32
InputRGB, float32, NCHW; H and W divisible by 14
Default processor size336×448 for 4:3 images
Tested resolutions224×294, 252×336, 336×448, 448×602, 518×686
Outputrelative inverse depth (affine-invariant; higher = closer)
FP32 safetensors66.04 MB
LicenseApache-2.0
Statuscommunity variant; float32 only in this repository

Highlights

  • 33.4% fewer parameters and 33.3% smaller fp32 checkpoint than Small.
  • 85%+ δ1 at all five tested resolutions on NYUv2 Eigen 654.
  • Best at 336×448: 89.36% δ1; native 518×686: 88.73% δ1.
  • Native-resolution δ1 retention is 97.4% of Small under the same harness.
  • Standard DepthAnythingForDepthEstimation; no custom ops. It loads with AutoModelForDepthEstimation and the saved processor.
  • Deterministic in eval mode; no dropout or stochastic depth.
  • A 4-bit ONNX deployment variant is available at Petrouil/Depth-Anything-V2-Tiny-hf-quant.

How it compares

ModelParamsFP32 sizeLayersReassembleNYU δ1 @ 518×686NYU δ1 @ 336×448
Depth Anything V2 Small24,785,08999.06 MB123840.9111*—
Depth Anything V2 Tiny (this model)16,504,12966.04 MB81920.88730.8936

* Measured with the evaluation harness described below. The official Depth Anything V2 paper reports δ1 0.973 for Small using a different protocol and alignment; the numbers are not directly comparable across papers. The table is a same-harness size/quality comparison, not a claim of parity.

At native resolution, Tiny is about 2.4 δ1 points lower than Small. It is intended for size-constrained deployments where ~89% δ1 is acceptable, not as a drop-in replacement for accuracy-critical applications. For higher accuracy, use the original Small model.

Architecture

The model is the standard DepthAnythingForDepthEstimation architecture with a smaller backbone and decoder:

  • DINOv2 ViT-S/14 backbone: 8 transformer layers, 6 attention heads, hidden size 384, patch size 14.
  • Multi-scale taps at stages 2, 5, 7, 8 (1-based positions in the 8-layer stack).
  • FFN width 1536 (not width-pruned); attention heads 6 (not head-pruned).
  • Reassemble channels [48, 96, 192, 192]; the factor-0.5 branch uses 192 channels instead of 384.
  • Fusion hidden size 64; depth head hidden size 32.
  • Relative-depth output, no metric-scale head.

The 8 layers are the first eight DINOv2 layers. Removing the deepest four layers removes most of the backbone parameters while preserving the early and mid-level features that the DPT decoder uses. The decoder was slimmed where it was most expensive: the 384-channel, stride-2 3×3 convolution in the factor-0.5 reassemble branch.

How it was made

Tiny was not trained from scratch. It was obtained by progressively pruning Small and then healing each step with the original Small as a teacher.

  1. Structured pruning. Starting from the official Small checkpoint, the backbone was reduced from 12 to 8 layers, the decoder reassemble branch was reduced from 384 to 192 channels, and the multi-scale taps were re-selected to [2, 5, 7, 8]. Attention heads and FFN width were kept at 6 and 1536.
  2. Distillation and healing. The original fp32 Small was used as the teacher. Inverse-depth targets were cached at 448×448, then the student was fine-tuned with a scale-and-shift-invariant L1 loss plus a gradient L1 term. The schedule used a decoder-only warm-up followed by a low-learning- rate full fine-tune at 448×448.
  3. Evaluation at deployment resolutions. The 8-layer fine-tune used 448×448 crops and did not receive a dedicated multi-scale fine-tune. It was evaluated at five resolutions, and 336×448 is the best measured point.

Training data

SplitImagesSources
Healing / training10,295COCO 2017 val 4,700; ADE20K train 5,000; NYUv2 train 595
Validation700COCO 2017 val 300; ADE20K val 200; NYUv2 train 200
Test654NYUv2 Eigen test

The NYUv2 test images were held out. COCO and ADE20K depth targets are teacher pseudo-labels from the original Small model; no human depth labels were used for those images. Training used a single NVIDIA RTX 1000 Ada Laptop GPU (6 GB), with PyTorch 2.11.0+cu128 and transformers 5.22.1.

Evaluation

Dataset: NYUv2 Eigen test split, 654 images. Ground truth from nyu_depth_v2_labeled.mat.

Protocol: the model's raw output is inverse depth. It is compared with 1 / GT_depth in inverse-depth space, with a per-image least-squares scale and shift alignment. RGB and GT are resized exactly to each target resolution. No test-time augmentation is used.

Resolutionδ1 ↑AbsRel ↓RMSE ↓log10 ↓SILog ↓
224×2940.86430.12480.08530.05116.837
252×3360.88330.11350.08020.04686.273
336×4480.89360.10760.07700.04446.019
448×6020.88460.11390.07970.04646.443
518×6860.88820.11150.07780.04556.312

All five resolutions pass the 85% δ1 gate. The strongest point is 336×448; the weakest is 224×294 at 86.43%. The processor-native 518×686 run (aspect- preserving preprocessing rather than exact resize) scores δ1 0.8873. The full metrics are in metrics_nyu654.json and metrics_native_518.json.

Teacher fidelity. On 200 held-out images at 336×448, against the original fp32 Small teacher: δ1 0.8976, AbsRel 0.1156, RMSE 0.3564, Pearson 0.8993, gradient correlation 0.6957. At the processor-native 518×686 size: δ1 0.8820, AbsRel 0.1407, RMSE 0.4235, Pearson 0.9085, gradient correlation 0.7026.

Usage

import torch
import torch.nn.functional as F
from PIL import Image
from transformers import AutoImageProcessor, AutoModelForDepthEstimation

repo_id = "Petrouil/Depth-Anything-V2-Tiny-hf"  # or a local directory

processor = AutoImageProcessor.from_pretrained(repo_id)
model = AutoModelForDepthEstimation.from_pretrained(repo_id)
model.eval()

image = Image.open("example.jpg").convert("RGB")

# The saved processor defaults to 336x448; pass `size` explicitly if needed.
inputs = processor(
    images=image,
    return_tensors="pt",
    size={"height": 336, "width": 448},
)

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

# Resize the relative-depth map back to the input image for visualization.
depth = F.interpolate(
    predicted_depth.unsqueeze(1),
    size=image.size[::-1],
    mode="bicubic",
    align_corners=False,
).squeeze(1)

# The raw output is inverse depth. Normalize only for visualization.
d = depth[0].cpu()
d = (d - d.min()) / (d.max() - d.min() + 1e-8)

Input contract

  • RGB image, float32, NCHW.
  • Height and width must be divisible by 14.
  • Recommended sizes: 224×294, 252×336, 336×448, 448×602, 518×686.
  • The saved processor preserves aspect ratio (keep_aspect_ratio=true) and uses ensure_multiple_of=14. For a 4:3 image, the default and an explicit size={"height": 336, "width": 448} both produce 336×448.
  • ImageNet normalization: mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225].

Output contract

  • predicted_depth: raw relative inverse depth; higher means closer.
  • The output is affine-invariant. For metric depth, fit a per-image scale and shift against ground-truth inverse depth; do not invert the raw output before that alignment.
  • For visualization, normalize the inverse-depth map; for metric evaluation, use the scale/shift alignment described above.

Checkpoint health

CheckResult
Parameters16,504,129
Dtypefloat32
Non-finite tensors0
Training modeeval(); 0 parameters require grad
Repeated forwardmax abs diff 0.0
Fresh clean load vs sourcemax abs diff 0.0
Hugging Face reload vs clean modelmax abs diff 0.0
CPU vs CUDA fp32max abs diff 0.00114
All five input sizesfinite, correct output shape

Bias, risks, and limitations

  • Indoor evaluation only. The model is evaluated on NYUv2 indoor scenes. Outdoor, night, rain, snow, and industrial scenes were not evaluated.
  • Relative depth only. The output has an unknown affine scale and shift; it is not metric depth without calibration.
  • Thin structures and small objects. No dedicated edge/boundary benchmark was run. Hair, wires, chair legs, and small objects may be weaker than the base model.
  • No temporal evaluation. Flicker and temporal consistency on video were not measured.
  • 224×294 margin. The lowest measured δ1 is 86.43%, only 1.43 points above the 85% gate. If your deployment uses 224×294 and needs more margin, use the original Small model or a larger Tiny variant.
  • Training-data bias. COCO, ADE20K, and NYUv2 do not represent all environments, cameras, skin tones, or lighting conditions. No fairness analysis was performed.
  • Not safety-critical. Do not use for navigation, manipulation, medical, or safety-critical decisions without independent validation.
  • Community model. This is not an official Depth Anything release and is not affiliated with or endorsed by the original authors.

License and attribution

This model is a derivative of depth-anything/Depth-Anything-V2-Small-hf, which is released under the Apache License 2.0. This derivative is released under the same license. See LICENSE and NOTICE.

Original Depth Anything V2 authors: Lihe Yang, Bingyi Kang, Zilong Huang, Zhen Zhao, Xiaogang Xu, Jiashi Feng, and Hengshuang Zhao.

Pruning, healing, evaluation, and this model card: Petros Fanioudakis.

Citation

If you use this model, please cite the original Depth Anything V2 paper and link this repository:

@article{yang2024depthanythingv2,
  title={Depth Anything V2},
  author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
  journal={arXiv preprint arXiv:2406.09414},
  year={2024}
}

Model card contact

Petros Fanioudakis — @Petrouil. For issues, open a discussion in the Hugging Face repository.

Framework versions

ComponentVersion
Python3.12
PyTorch2.11.0+cu128
transformers5.22.1
safetensorscurrent transformers dependency
Pillow13.0.0

The model uses standard DepthAnythingForDepthEstimation layers. A recent transformers release with Depth Anything V2 support (4.45+) should load it; the published checkpoint was verified with 5.22.1.

Quantized and converted variants

This repository contains the float32 model only. A 4-bit ONNX deployment variant is published separately:

Int8 QDQ and other conversions are experimental. See the quantized model card for measured results and portability caveats.

Acknowledgements

Thanks to the Depth Anything V2 authors for the original model and the Hugging Face team for the transformers implementation and hosting.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей