dinov2-vits14.safetensors — DINOv2 ViT-S/14 weights packed into the layout expected by the candle framework's dinov2::vitsmall model. Drop-in for on-device image feature extraction in Rust.
Fuente del modelo
Descripción de la fuente
dinov2-vits14.safetensors — DINOv2 ViT-S/14 weights packed into the layout
expected by the candle framework's
dinov2::vit_small model. Drop-in for on-device image feature extraction in
Rust.
These are the parameters of plus Meta's official ImageNet linear-probe head, re-packed for candle (the separate query/key/value attention projections are fused into a single tensor, and tensor keys are renamed to candle's convention).
Fuentes
1 fuenteVerificado 5 ago
Artefactos del modelo
1 artefactoExtractos de fuentes
2 extractosqkvcandle's vit_small expects a fused qkv and candle-style key names, which
the upstream HF checkpoint doesn't use. Existing candle-format re-hosts are
licensed CC-BY-NC or carry no license, which is unusable commercially. This repo
provides the same weights under Apache-2.0, derived entirely from
Apache-2.0 sources.
| Tensors | Source (Apache-2.0) |
|---|---|
Backbone (patch embed, 12 transformer blocks, final norm; fused qkv) | facebook/dinov2-small |
head.weight (1000×768), head.bias (1000) — ImageNet linear probe | dinov2_vits14_linear_head.pth |
mask_token (zeros, training-only) | facebook/dinov2-small |
candle::dinov2::vit_small's forward pass returns the 1000-d linear-probe
output; used here as a dense image descriptor for visual-similarity ranking.
use candle_transformers::models::dinov2;
let vb = unsafe {
candle_nn::VarBuilder::from_mmaped_safetensors(
&["dinov2-vits14.safetensors"], candle_core::DType::F32, &device)?
};
let model = dinov2::vit_small(vb)?;
let descriptor = model.forward(&image_tensor)?; // (1, 1000)
Apache-2.0 (see LICENSE). Derived from DINOv2 © Meta Platforms, Inc.; see
NOTICE. Original work: facebookresearch/dinov2
(Oquab et al., 2023).
--- license: apache-2.0 library_name: candle tags: - dinov2 - image-feature-extraction - vision - candle base_model: facebook/dinov2-small --- # DINOv2 ViT-S/14 — candle format `dinov2-vits14.safetensors` — DINOv2 ViT-S/14 weights packed into the layout expected by the [`candle`](https://github.com/huggingface/candle) framework's `dinov2::vit_small` model. Drop-in for on-device image feature extraction in Rust. These are the **numerically-identical** parameters of [`facebook/dinov2-small`](https://huggingface.co/facebook/dinov2-small) plus Meta's official ImageNet linear-probe head, re-packed for candle (the separate query/key/value attention projections are fused into a single `qkv` tensor, and tensor keys are renamed to candle's convention). **No weights were retrained or altered in value.** ## Why this exists candle's `vit_small` expects a *fused* `qkv` and candle-style key names, which the upstream HF checkpoint doesn't use. Existing candle-format re-hosts are licensed CC-BY-NC or carry no license, which is unusable commercially. This repo provides the same weights under **Apache-2.0**, derived entirely from Apache-2.0 sources. ## Contents | Tensors | Source (Apache-2.0) | |---------|---------------------| | Backbone (patch embed, 12 transformer blocks, final norm; fused `qkv`) | [`facebook/dinov2-small`](https://huggingface.co/facebook/dinov2-small) | | `head.weight` (1000×768), `head.bias` (1000) — ImageNet linear probe | [`dinov2_vits14_linear_head.pth`](https://dl.fbaipublicfiles.com/dinov2/dinov2_vits14/dinov2_vits14_linear_head.pth) | | `mask_token` (zeros, training-only) | `facebook/dinov2-small` | `candle::dinov2::vit_small`'s forward pass returns the 1000-d linear-probe output; used here as a dense image descriptor for visual-similarity ranking. ## Usage (candle) ```rust use candle_transformers::models::dinov2; let vb = unsafe { candle_nn::VarBuilder::from_mmaped_safetensors( &["dinov2-vits14.safetensors"], candle_core::DType::F32, &device)? }; let model = dinov2::vit_small(vb)?; let descriptor = model.forward(&image_tensor)?; // (1, 1000) ``` ## License & attribution Apache-2.0 (see `LICENSE`). Derived from DINOv2 © Meta Platforms, Inc.; see `NOTICE`. Original work: [facebookresearch/dinov2](https://github.com/facebookresearch/dinov2) (Oquab et al., 2023).
Source context: 0 downloads · 0 likes · Pipeline image-feature-extraction · Library candle · Repo SimCubeLtd/dinov2-vits14-candle