/ Модель

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

Параметры
113 млн
Лицензия
Своя лицензия
Архитектура
dinov3_vit · dense
Базовая модель
dinov3-vitb16-pretrain-lvd1689m
Библиотека
codon
Опубликована
17 сен 2026

DINOv3-ViT-Base

Эмбеддинги изображенийИзображение → embedding3 профессии

DINOv3 ViT-B/16 в формате codon извлекает векторные и плотные признаки изображений для последующих задач компьютерного зрения.

31скачиваний за 30 дней0лайковвеса обновлены17 сен 2026

Бенчмарки

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

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

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

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

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

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

CodonProject публикует веса DINOv3 ViT-B/16 для реализации DINOv3 в библиотеке codon. Это визуальный энкодер на архитектуре ViT с 12 слоями Transformer, двунаправленным вниманием и двумерным axial RoPE; в README указаны скрытый размер 768 и 85,7 млн параметров, а в метаданных Hugging Face — 113,2 млн. Репозиторий содержит преобразованные веса facebook/dinov3-vitb16-pretrain-lvd1689m: ключи переименованы под формат codon, а веса сохранены в float16; модель не дообучалась. README сообщает о численной проверке преобразования относительно реализации Transformers и о поддержке извлечения плотных признаков при разных размерах изображений.

Модель предназначена для получения векторных признаков изображений, которые можно использовать в задачах компьютерного зрения, например для поиска и классификации. По умолчанию модель возвращает CLS-вектор размерности 768; также доступны плотные признаки и промежуточные слои. Она принимает изображения и выдаёт векторы признаков. В карточке указана лицензия other; конкретные условия лицензии в предоставленных данных не раскрыты.

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

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

Ограничения

Веса сохранены в float16, поэтому при экспорте произошло округление относительно исходного чекпойнта fp32. Для получения точных параметров исходного fp32 чекпойнта эта копия не подходит; условия лицензии other требуют отдельной проверки.

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

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

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

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

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

Открыть на Hugging Face

DINOv3 ViT-B/16 — converted weights (codon layout, float16)

This repository hosts the weights of facebook/dinov3-vitb16-pretrain-lvd1689m converted for the codon implementation of DINOv3:

  • renamed to the codon naming convention (codon.impl.DINOv3ViT),
  • cast to float16 (2× smaller than the original fp32 checkpoint),
  • numerically verified against the original weights and against the transformers reference implementation.

The model itself is unchanged: same architecture, same parameter values, same numerics up to fp16 quantization.

Why this exists

The upstream checkpoints use the transformers/Meta naming layout (layer.{i}.attention.*, layer_scale{1,2}.lambda1, embeddings.*) and ship in fp32. codon.impl.DINOv3ViT uses its own convention (all linear layers are *_proj, the block list is blocks, Layer Scale is gamma{1,2}, register tokens are storage_tokens), so the weights need a one-time remap. This repository is that remap, pre-applied and stored in fp16 so it can be loaded directly with a single call.

Files

FileDescription
model.safetensors163.4 MB, 211 tensors, all F16, codon key layout
config.jsonArchitecture summary plus "dtype": "float16" and "key_layout": "codon"
preprocessor_config.jsonImage preprocessing parameters, carried over from the original model
README.mdThis file

Key mapping

Original (transformers / Meta)codon
embeddings.patch_embeddings.*patch_embed.*
embeddings.cls_tokencls_token
embeddings.register_tokensstorage_tokens
layer.{i}.attention.q_proj.*blocks.{i}.q_proj.*
layer.{i}.attention.k_proj.*blocks.{i}.k_proj.*
layer.{i}.attention.v_proj.*blocks.{i}.v_proj.*
layer.{i}.attention.o_proj.*blocks.{i}.o_proj.*
layer.{i}.norm1.* / norm2.*blocks.{i}.norm1.* / norm2.*
layer.{i}.mlp.up_proj.* / down_proj.*blocks.{i}.up_proj.* / down_proj.*
layer.{i}.layer_scale1.lambda1blocks.{i}.gamma1
layer.{i}.layer_scale2.lambda1blocks.{i}.gamma2
norm.*norm.*
rope_embeddings.inv_freqdropped (rebuilt dynamically from input shape)

Two notes on the conversion:

  • The inv_freq rotary table is not stored. In this implementation the 2D axial RoPE frequencies are recomputed from rope_theta and the input resolution at runtime (a non-persistent buffer), which is what lets the same weights run at any image size.
  • A zero-initialized mask_token is included as a placeholder. It is part of this implementation's MAE architecture but is absent from the original checkpoint; load_pretrained(strict=True) does not require it.

Model overview

PropertyValue
ArchitectureDINOv3 ViT (pre-norm Transformer, bidirectional attention, 2D axial RoPE)
Parameters85.7 M
Hidden size768
Layers / attention heads12 / 12
MLP hidden size3072 (ratio 4, GELU)
Patch size / default resolution16 / 224×224
Register tokens4
RoPE theta100.0
Layer-norm eps1e-5
Layer Scale init1.0
Attention biasesq/v/o yes, k no
Drop path0.0 (inference)
Weight dtypefloat16

Usage

import torch
from codon.impl import DINOv3ViT_Base

# Pulls config.json + model.safetensors from this repository.
# config.json says dtype=float16, so the model is built in float16.
model = DINOv3ViT_Base.from_remote().eval()

# Prefer fp32 compute? The weights are upcast on load.
model32 = DINOv3ViT_Base.from_remote(dtype=torch.float32).eval()

from_remote() reads the architecture from config.json — num_register_tokens, rope_theta, pos_embed_rescale, layer_norm_eps, key_bias and dtype are all applied automatically, so no manual configuration is needed.

To load the file yourself:

model = DINOv3ViT_Base().half()
model.load_pretrained('model.safetensors', strict=True, dtype=torch.float16)

Feature extraction

x = torch.randn(1, 3, 224, 224).half()

with torch.no_grad():
    feats = model.forward_features(x)

feats['x_norm_clstoken']        # [1, 768]        CLS token, post-norm
feats['x_storage_tokens']       # [1, 4, 768]     4 register tokens, post-norm
feats['x_norm_patchtokens']     # [1, 196, 768]   14x14 patch tokens, post-norm
feats['x_norm_alltokens']       # [1, 201, 768]   full post-norm sequence
feats['x_prenorm']              # [1, 201, 768]   full pre-norm sequence

forward(x) (the default, is_training=False) returns just the CLS token of shape [N, 768].

Dense features at arbitrary resolutions work without interpolation, because the RoPE frequencies are derived from the actual patch grid:

model.forward_features(torch.randn(1, 3, 256, 192).half())['x_norm_patchtokens'].shape
# torch.Size([1, 192, 768])   -> 16x12 patch grid

Intermediate layers, optionally reshaped to feature maps:

with torch.no_grad():
    layers = model.get_intermediate_layers(x, n=[0, 5, 11])          # tuple of [N, HW, C]
    maps = model.get_intermediate_layers(x, n=1, reshape=True)       # [N, C, 14, 14]

Verification

The conversion was checked at every step, and these checks are reproducible via test/test_dinov3_vit.py in the codon repository:

CheckResult
Key remap + strict=True load from model.safetensorspasses
fp32 remapped weights vs transformers DINOv3ViTModel, 224×224 and 196×252`max
Per-block outputs vs transformers output_hidden_states (layers 0, 5, 11)`max
fp16 forward vs original fp32 model (CLS token)`max
fp16 weight quantization error (per tensor)≤ 2.0e-03
Save → reload round trip`max

The fp16 error is well within the expected range for a 12-layer model: activations reach an order of magnitude of ~10-30, and fp16 carries roughly three significant decimal digits.

Precision notes

  • Inference in float16 works on CPU and CUDA. The rotary cos/sin tables are computed in fp32 and then cast to the activation dtype, so attention inputs stay in float16 throughout instead of being silently promoted to fp32.
  • If you need maximum fidelity, use dtype=torch.float32; the weights are exact float16 representations of the original fp32 values, so this only recovers the rounding that happened at export time.

License

The weights are derived from Meta's DINOv3 and remain subject to the DINOv3 License. Please read and comply with that license before use. In particular, the license governs acceptable use, redistribution and attribution; this conversion adds no additional permissions and no warranty.

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

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

GPU в ailist

Универсальный рантайм · codon · image-feature-extraction

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

Подбираем GPU…

Класс архитектуры
DINOv3ViT
Ревизия весов
245a427

0 моделей