/ Модель

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

Лицензия
Apache 2.0
Архитектура
efficientvit_depth_5m · dense
Библиотека
onnx
Опубликована
7 ноя 2026

EfficientViT-Depth-5M

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

Компактная модель EfficientViT-M2 с декодером Lite-DPT оценивает относительную глубину RGB-изображений и рассчитана на быстрый запуск, в том числе на CPU.

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

Бенчмарки

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

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

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

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

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

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

EfficientViT-Depth-5M — независимая компактная модель для оценки относительной глубины, разработанная сообществом. Она использует CNN-энкодер EfficientViT-M2 и лёгкий декодер Lite-DPT; в модели около 4,85 млн параметров. Depth Anything V2 Small применялась только как учитель для генерации целей дистилляции: веса, слои и архитектура этой модели не унаследованы от Depth Anything V2. Доступны веса Safetensors и графы ONNX, включая вариант с динамическим разрешением.

Модель принимает RGB-изображение и выдаёт карту обратной относительной глубины. Основной режим — 336×448; на этом разрешении заявлены 0,8546 δ1 на тестовом разбиении NYUv2 Eigen-654 и задержка 12,1 мс на CPU в ONNX Runtime при указанных в карточке настройках. Она подходит для быстрой оценки структуры сцены на CPU и экономии памяти, но уступает более крупным моделям в деталях.

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

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

EfficientViT-Depth-5M

A 4.85M-parameter relative-depth model with an EfficientViT-M2 encoder and a Lite-DPT decoder, trained with Depth Anything V2 Small as a teacher.

This is an independent community model, not an official Depth Anything release, and it is not a fine-tune, derivative, or pruned version of Depth Anything V2. No Depth Anything weights, layers, or architecture are inherited. The architecture is deliberately different: a compact CNN encoder with a lightweight DPT-style decoder, aimed at small size and low CPU latency. Depth Anything V2 Small is used only to generate distillation targets.

comparison

Float vs INT8 size/quality comparison.

example

NYUv2 indoor scene; float vs INT8 at 336×448.

examples

Qualitative examples on ADE20K/NYUv2 scenes; per-row color scale.

Highlights

  • 4,854,203 parameters, 9.84 MB fp32 ONNX (static 336×448)
  • 0.8546 NYU-654 δ1 at 336×448 (inverse-depth protocol, affine alignment)
  • 0.7242 teacher-fidelity δ1 on 700 held-out images
  • 12.1 ms / 82.5 FPS on CPU with ONNX Runtime, 8 threads, 336×448
  • Dynamic-resolution ONNX graph included
  • INT8 sibling: EfficientViT-Depth-5M-int8 — 3.48 MB, 0.8319 NYU δ1

Comparison

All quality numbers are at 336×448 on the 654-image NYUv2 Eigen test split. “Teacher fidelity” is agreement with the original fp32 Depth Anything V2 Small teacher on held-out distillation data.

modelparamsdiskNYU-654 δ1teacher fidelity δ1note
Depth Anything V2 Small24.79M99.06 MB0.92131.000original teacher
Depth Anything V2 Tiny (8-layer)16.50M66.04 MB0.89360.8976pruned DA-V2 transformer
EfficientViT-Depth-5M (float)4.85M9.84 MB0.85460.7242this model
EfficientViT-Depth-5M (INT8)4.85M3.48 MB0.83190.6729INT8 repo
EfficientViT-Depth-5M (4-bit, experimental)4.85M2.31 MB0.64560.4260not shipped; conv 4-bit QDQ collapses

Relative to Depth Anything V2 Small, this model uses 80.4% fewer parameters and is 90.1% smaller in fp32 ONNX, while retaining 92.8% of its NYU-654 δ1. Relative to the 8-layer Tiny, it uses 70.6% fewer parameters and is 85.1% smaller, retaining 95.6% of its NYU-654 δ1. Teacher fidelity is lower than both, so it is a size/latency-oriented model rather than a drop-in replacement for their detail.

Architecture

componentdetail
encoderEfficientViT-M2, ImageNet-pretrained, 3.96M params
decoderLite-DPT: 1×1 laterals, stride-32 ASPP, top-down fusion, depthwise-separable residual blocks (2 per level)
decoder channels80 / 112 / 144 / 176
ASPP hidden64
outputaffine-invariant inverse depth, higher = closer
inputRGB, 336×448, ImageNet normalization
inference params4,854,203

Deep supervision at stride 8 and 16 is used only during training. The released float checkpoint and ONNX graph are the clean inference model without auxiliary heads.

The network pads the input internally to a multiple of 32, runs the encoder/decoder, and bilinearly resizes the depth map back to the original input size.

Metrics

NYUv2 Eigen-654, 336×448

metricvalue
δ10.854563
AbsRel0.126748
RMSE0.079416

The protocol is inverse-depth space with per-image affine scale and shift alignment. The model predicts inverse depth; the ground-truth metric depth is inverted before alignment.

Resolution sweep (PyTorch, NYU-654)

resolutionδ1AbsRelRMSE
224×2940.6329130.2381410.129551
252×3360.8052050.1530380.092275
336×4480.8533740.1270790.079458
448×6020.8121160.1479020.089518
518×6860.7300830.1935710.115353

336×448 is the primary deployment point and the clear sweet spot. 224×294 is substantially weaker; use 252×336 or higher when possible.

Teacher fidelity

Scale-and-shift aligned inverse-depth agreement with the fp32 Depth Anything V2 Small teacher:

eval setδ1AbsRelPearsongradient corr
700 held-out images0.7241690.3135510.9140050.379217
2,200 held-out images0.6812090.3952520.8962040.344748

The gap to the teacher is concentrated in fine structure and high-frequency detail, not overall layout.

Usage

ONNX Runtime

pip install -r requirements.txt
python example.py --image photo.jpg --output depth.png

The example resizes the RGB image to exactly 336×448, applies ImageNet normalization, runs the ONNX graph, and writes a normalized grayscale preview plus optional raw .npy inverse depth.

Minimal code:

import numpy as np
from PIL import Image
import onnxruntime as ort

mean = np.array([0.485, 0.456, 0.406], dtype=np.float32)
std = np.array([0.229, 0.224, 0.225], dtype=np.float32)

image = Image.open("photo.jpg").convert("RGB").resize((448, 336), Image.Resampling.BICUBIC)
x = np.asarray(image, dtype=np.float32) / 255.0
x = (x - mean) / std
x = np.transpose(x, (2, 0, 1))[None].astype(np.float32)

session = ort.InferenceSession("efficientvit_depth_5m_fp32.onnx", providers=["CPUExecutionProvider"])
depth = session.run(None, {session.get_inputs()[0].name: x})[0][0]
# depth is inverse depth: higher = closer, not metric depth

PyTorch

import torch
from efficientvit_depth_5m import load_compact

model = load_compact("efficientvit_depth_5m_fp32.pt").eval()
x = torch.randn(1, 3, 336, 448)
with torch.no_grad():
    depth = model(pixel_values=x).predicted_depth

efficientvit_depth_5m.py is the full model definition. It requires torch and timm. The .pt checkpoint carries its own config, so load_compact needs no extra arguments.

The same weights are also provided as model.safetensors, a complete state_dict including BatchNorm running statistics. It loads standalone, but the architecture has to be constructed explicitly:

from safetensors.torch import load_file
from efficientvit_depth_5m import CompactDepthModel

model = CompactDepthModel(
    "efficientvit_m2",
    pretrained=False,
    channels=(80, 112, 144, 176),
    blocks_per_level=2,
    aspp_hidden=64,
).eval()
model.load_state_dict(load_file("model.safetensors"))

The two files are numerically identical: same tensors, bit-for-bit.

Dynamic resolution

efficientvit_depth_5m_fp32_dynamic.onnx accepts dynamic height and width. It was verified at 252×336, 336×448, and 448×602. The network pads internally to a multiple of 32. For best quality, use 336×448.

Output interpretation

The output is affine-invariant inverse depth, not metric depth. To compare with metric depth z:

  1. Compute 1 / z.
  2. Fit a per-image scale and shift between prediction and 1 / z.
  3. Report error after alignment.

For visualization, normalize per image. Do not interpret the raw values as meters.

Training

  • Teacher: original fp32 depth-anything/Depth-Anything-V2-Small-hf
  • Data: 23,805 training images from COCO, ADE20K, and NYUv2 train; 2,200 held-out validation images; NYUv2 Eigen-654 test kept separate
  • Schedule: 224×294 / 252×336 / 336×448 multi-resolution training, then a deep-supervision fine-tune
  • Loss: scale-shift-invariant L1 on inverse depth + gradient L1; auxiliary stride-8/16 heads during the deep-supervision stage
  • Optimizer: AdamW, cosine schedule, EMA weights
  • Encoder initialization: ImageNet-pretrained EfficientViT-M2, then distillation

No NYUv2 test images were used for training or model selection.

Limitations

  • Relative inverse depth only; no metric scale.
  • 336×448 is the intended resolution. 224×294 is much weaker, and 448/518 degrade without resolution-specific fine-tuning.
  • Fine structures, thin objects, clutter, transparent/reflective surfaces, and extreme depth ranges can be inaccurate.
  • Teacher fidelity is lower than Depth Anything V2 Small and the 8-layer Tiny; this model trades detail for size and CPU speed.
  • No temporal or multi-frame consistency.
  • Not an official Depth Anything release and not affiliated with its authors.

Files

filedescription
efficientvit_depth_5m_fp32.onnxstatic 336×448 float ONNX
efficientvit_depth_5m_fp32_dynamic.onnxdynamic-resolution float ONNX
efficientvit_depth_5m_fp32.ptclean PyTorch checkpoint (state_dict, config, params)
model.safetensorscomplete state_dict in safetensors format, including BatchNorm statistics
efficientvit_depth_5m.pyPyTorch model definition and load_compact
config.jsonarchitecture and I/O metadata
preprocessor_config.jsonresize/normalization metadata
metrics.jsonfull metrics and artifact hashes
example.pyONNX Runtime example
comparison.pngquality and size comparison
example.pngqualitative float vs INT8 example
examples.pngfive-scene qualitative gallery
checksums.txtSHA256 checksums

model.safetensors holds the 4,854,203 trained parameters plus 50,629 BatchNorm running-statistic values. The Hub parameter badge counts every tensor in the file, so it shows about 4.90M; the trained parameter count is 4.85M.

License

Apache-2.0. See LICENSE and NOTICE. The teacher, Depth Anything V2 Small, is also Apache-2.0.

Contact

Petros Fanioudakis — @Petrouil

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

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

GPU в ailist

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

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

Подбираем GPU…

Ревизия весов
6802939

0 моделей