Models · Feature backbones

DINOv2

Meta's DINOv2: self-supervised image features (patch and class tokens) in four sizes, with and without register tokens. Commercially usable.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
dinov2-vits14synthetic (224x224)original (fp32)
original
portable
kernels
3.30
4.40
2.95
0.848
121 / 132
160 / 166
79 / 98
112 / 148
dinov2-vits14-regsynthetic (224x224)original (fp32)
original
portable
kernels
4.11
5.59
2.98
0.814
121 / 132
160 / 168
80 / 98
112 / 142
dinov2-vitb14synthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
6.90
4.50
2.92
1.48
2.20
1.30
371 / 386
530 / 548
205 / 226
237 / 290
240 / 266
198 (engine)
dinov2-vitb14-regsynthetic (224x224)original (fp32)
original
portable
kernels
7.00
4.30
2.94
1.50
371 / 386
530 / 548
207 / 226
237 / 288
dinov2-vitl14synthetic (224x224)original (fp32)
original
portable
kernels
22.8
9.80
6.12
4.59
1205 / 1224
1777 / 1784
622 / 646
655 / 714
dinov2-vitl14-regsynthetic (224x224)original (fp32)
original
portable
kernels
22.5
10.7
6.17
4.60
1205 / 1226
1777 / 1786
625 / 646
655 / 714
dinov2-vitg14synthetic (224x224)original (fp32)
original
portable
kernels
86.4
33.9
18.9
13.2
4389 / 4406
6542 / 6548
2216 / 2230
2246 / 2318
dinov2-vitg14-regsynthetic (224x224)original (fp32)
original
portable
kernels
86.6
34.2
18.7
13.0
4389 / 4406
6542 / 6568
2217 / 2228
2222 / 4430
Details
  • Original code: https://github.com/facebookresearch/dinov2 at 7764ea0
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0
  • Licence evidence: https://github.com/facebookresearch/dinov2/blob/7764ea0/README.md (License section: code and model weights under Apache 2.0)
  • Training data: LVD-142M: 142M images retrieved from web crawls by similarity to curated datasets (ImageNet-22k/1k train, Google Landmarks, fine-grained sets), self-supervised (no labels), per the paper; not released
  • Options: fp16_accumulate = False (precision only)
  • Kernel libraries: fastbb
  • Variants: dinov2-vits14, dinov2-vits14-reg, dinov2-vitb14, dinov2-vitb14-reg, dinov2-vitl14, dinov2-vitl14-reg, dinov2-vitg14, dinov2-vitg14-reg
  • Outputs: last_hidden_state, pooler_output, hidden_states
  • Input size: any H x W >= 1, resized or padded inside the model
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): dinov2-vits14 3000x4000 (0.8 GiB peak allocated, 1.2 reserved); dinov2-vits14-reg 3000x4000 (0.8 GiB peak allocated, 1.2 reserved); dinov2-vitb14 3000x4000 (1.4 GiB peak allocated, 2.2 reserved); dinov2-vitb14-reg 3000x4000 (1.4 GiB peak allocated, 2.2 reserved); dinov2-vitl14 3000x4000 (2.2 GiB peak allocated, 3.1 reserved); dinov2-vitl14-reg 3000x4000 (2.2 GiB peak allocated, 3.1 reserved); dinov2-vitg14 3000x4000 (4.8 GiB peak allocated, 5.9 reserved); dinov2-vitg14-reg 3000x4000 (4.8 GiB peak allocated, 5.9 reserved)
  • dinov2-vitb14 224x224, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 25 s (ONNX + engine).
  • dinov2-vits14 original 224x224: torch.autocast(fp16) around the forward
  • dinov2-vits14-reg original (fp32) 224x224, original 224x224: dinov2 forward_features CLS
  • dinov2-vitb14 original 224x224: torch.autocast(fp16) around the forward
  • dinov2-vitb14-reg original 224x224: torch.autocast(fp16) around the forward
  • dinov2-vitl14 original 224x224: torch.autocast(fp16) around the forward
  • dinov2-vitl14-reg original (fp32) 224x224, original 224x224: dinov2 forward_features CLS
  • dinov2-vitg14 original 224x224: torch.autocast(fp16) around the forward
  • dinov2-vitg14-reg original (fp32) 224x224, original 224x224: dinov2 forward_features CLS
  • dinov2-vits14 load / first call: original 0.41 s / 0.174 s, portable 0.07 s / 0.118 s, kernels 0.07 s / 0.153 s
  • dinov2-vits14-reg load / first call: original 1.32 s / 0.107 s, portable 0.21 s / 0.126 s, kernels 0.08 s / 0.167 s
  • dinov2-vitb14 load / first call: original 1.51 s / 0.006 s, portable 0.27 s / 0.205 s, kernels 0.19 s / 0.191 s
  • dinov2-vitb14-reg load / first call: original 1.71 s / 0.035 s, portable 0.59 s / 0.042 s, kernels 0.21 s / 0.205 s
  • dinov2-vitl14 load / first call: original 7.06 s / 0.013 s, portable 0.57 s / 0.148 s, kernels 0.57 s / 0.179 s
  • dinov2-vitl14-reg load / first call: original 4.6 s / 0.068 s, portable 0.66 s / 0.113 s, kernels 0.56 s / 0.205 s
  • dinov2-vitg14 load / first call: original 19.29 s / 0.046 s, portable 4.37 s / 0.104 s, kernels 2.22 s / 0.162 s
  • dinov2-vitg14-reg load / first call: original 14.67 s / 0.089 s, portable 4.32 s / 0.033 s, kernels 2.91† s / 0.017 s
  • † measured in the speed sweep after the portable load (or an earlier size) in the same process: file cache and kernels are warm, so the time is lower than a fresh start.
  • Protocol, dinov2-vits14, dinov2-vits14-reg, dinov2-vitb14, dinov2-vitb14-reg, dinov2-vitl14, dinov2-vitl14-reg, dinov2-vitg14: first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
  • Protocol, dinov2-vitg14-reg: median of 5 after 3 warm-up, uint8 CUDA input (synthetic for bench_inputs sizes), card defaults; gc before each load; peak = max over the first call and the timed calls

Measured

Two disjoint seeded subsets of the val folders; each image shorter side 256 (bicubic), centre crop 224, the CLS / pooled feature; cosine kNN, vote weighted by similarity. Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32original fp16portablekernelsnote
dinov2-vits14ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)59.2059.2259.2659.16
dinov2-vits14-regImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)59.9860.0059.9659.96
dinov2-vitb14ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)67.8067.7667.7467.78
dinov2-vitb14-regImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)69.1469.1869.1469.18
dinov2-vitl14ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)72.1272.1672.1872.14
dinov2-vitl14-regImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)73.0873.0873.0673.08
dinov2-vitg14ImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)70.6470.6670.6470.68
dinov2-vitg14-regImageNet-1k val, kNN top-1 % (k = 20, 10000 labelled / 5000 test images)72.6072.5872.6072.64

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.

Parity

CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 2.5 % and p99 <= 12 % of the reference's median |value| (absolute error of the output last_hidden_state).

variantkernels error vs original, mean / p99GPU, torchkernels used
dinov2-vits140.01036 / 0.03758RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120
dinov2-vits14-reg0.00541 / 0.0198RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120
dinov2-vitb140.01295 / 0.05042RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120
dinov2-vitb14-reg0.01032 / 0.03738RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120
dinov2-vitl140.01558 / 0.08667RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120
dinov2-vitl14-reg0.01356 / 0.05036RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120
dinov2-vitg140.00785 / 0.0449RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120
dinov2-vitg14-reg0.00779 / 0.04094RTX 5060 Ti, torch 2.14.1+cu130fastbb@7d058322634d:sm_120