dinov3 README

The project's README from github.com/facebookresearch/dinov3. As one markdown file: README.md.

:new: [2026-06-12] :fire: Metadata-guided training code and reference recipes (FMoW satellite imagery, HPA-WholeHR fluorescence imagery) are now released on the FINO branch, accompanying Who Needs Labels? Adapting Vision Foundation Models With the Metadata You Already Have (Gardès et al., 2026).

[2026-03-10] The Canopy Height Maps v2 (CHMv2) model and inference code are now available (more details on downloading the model weights and using the code here). The model weights are also available in Hugging Face Hub and supported by the Hugging Face Transformers library. Building on our original high-resolution canopy height maps released in 2024, CHMv2 delivers substantial improvements in accuracy, detail, and global consistency by leveraging DINOv3.

[2025-11-20] Distillation code and configurations for ConvNeXt backbones are now released!

[2025-10-13] Semantic segmentation (ADE20K) and monocular depth estimation (NYUv2-Depth) linear probing code are now released!

[2025-09-17] DINOv3 backbones are now supported by the PyTorch Image Models / timm library starting with version 1.0.20

[2025-08-29] DINOv3 backbones are supported by released versions of the Hugging Face Transformers library starting with version 4.56.0

[2025-08-14] DINOv3 backbones are now available in Hugging Face Hub and supported by the development version of the Hugging Face Transformers library

DINOv3 🦖🦖🦖

Meta AI Research, FAIR

Oriane Siméoni, Huy V. Vo, Maximilian Seitzer, Federico Baldassarre, Maxime Oquab,
Cijo Jose, Vasil Khalidov, Marc Szafraniec, Seungeun Yi, Michaël Ramamonjisoa,
Francisco Massa, Daniel Haziza, Luca Wehrstedt, Jianyuan Wang,
Timothée Darcet, Théo Moutakanni, Leonel Sentana, Claire Roberts,
Andrea Vedaldi, Jamie Tolan, John Brandt, Camille Couprie,
Julien Mairal, Hervé Jégou, Patrick Labatut, Piotr Bojanowski

[ :scroll: Paper] [ :newspaper: Blog] [ :globe_with_meridians: Website] [ :book: BibTeX]

Reference PyTorch implementation and models for DINOv3. For details, see the DINOv3 paper.

Overview

market

High-resolution dense features.
We visualize the cosine similarity maps obtained with DINOv3 output features
between the patches marked with a red cross and all other patches.


An extended family of versatile vision foundation models producing high-quality dense features and achieving outstanding performance on various vision tasks including outperforming the specialized state of the art across a broad range of settings, without fine-tuning

Pretrained models

:information_source: Please follow the link provided below to get access to all the model weights: once accepted, an e-mail will be sent with the complete list of URLs pointing to all the available model weights (both backbones and adapters). These URLs can then be used to either:

See the example code snippets below.

:warning: Please use wget instead of a web browser to download the weights.

ViT models pretrained on web dataset (LVD-1689M):

Model Parameters Pretraining
Dataset
Download
ViT-S/16 distilled 21M LVD-1689M [link]
ViT-S+/16 distilled 29M LVD-1689M [link]
ViT-B/16 distilled 86M LVD-1689M [link]
ViT-L/16 distilled 300M LVD-1689M [link]
ViT-H+/16 distilled 840M LVD-1689M [link]
ViT-7B/16 6,716M LVD-1689M [link]

ConvNeXt models pretrained on web dataset (LVD-1689M):

Model Parameters Pretraining
Dataset
Download
ConvNeXt Tiny 29M LVD-1689M [link]
ConvNeXt Small 50M LVD-1689M [link]
ConvNeXt Base 89M LVD-1689M [link]
ConvNeXt Large 198M LVD-1689M [link]

ViT models pretrained on satellite dataset (SAT-493M):

Model Parameters Pretraining
Dataset
Download
ViT-L/16 distilled 300M SAT-493M [link]
ViT-7B/16 6,716M SAT-493M [link]

Pretrained backbones (via PyTorch Hub)

Please follow the instructions here to install PyTorch (the only required dependency for loading the model). Installing PyTorch with CUDA support is strongly recommended.

import torch

REPO_DIR = <PATH/TO/A/LOCAL/DIRECTORY/WHERE/THE/DINOV3/REPO/WAS/CLONED>

# DINOv3 ViT models pretrained on web images
dinov3_vits16 = torch.hub.load(REPO_DIR, 'dinov3_vits16', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_vits16plus = torch.hub.load(REPO_DIR, 'dinov3_vits16plus', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_vitb16 = torch.hub.load(REPO_DIR, 'dinov3_vitb16', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_vitl16 = torch.hub.load(REPO_DIR, 'dinov3_vitl16', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_vith16plus = torch.hub.load(REPO_DIR, 'dinov3_vith16plus', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_vit7b16 = torch.hub.load(REPO_DIR, 'dinov3_vit7b16', source='local', weights=<CHECKPOINT/URL/OR/PATH>)

# DINOv3 ConvNeXt models pretrained on web images
dinov3_convnext_tiny = torch.hub.load(REPO_DIR, 'dinov3_convnext_tiny', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_convnext_small = torch.hub.load(REPO_DIR, 'dinov3_convnext_small', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_convnext_base = torch.hub.load(REPO_DIR, 'dinov3_convnext_base', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_convnext_large = torch.hub.load(REPO_DIR, 'dinov3_convnext_large', source='local', weights=<CHECKPOINT/URL/OR/PATH>)

# DINOv3 ViT models pretrained on satellite imagery
dinov3_vitl16 = torch.hub.load(REPO_DIR, 'dinov3_vitl16', source='local', weights=<CHECKPOINT/URL/OR/PATH>)
dinov3_vit7b16 = torch.hub.load(REPO_DIR, 'dinov3_vit7b16', source='local', weights=<CHECKPOINT/URL/OR/PATH>)

Pretrained backbones (via Hugging Face Transformers)

All the backbones are available in the DINOv3 collection on Hugging Face Hub and supported via the Hugging Face Transformers library (with released packages from version 4.56.0). Please refer to the corresponding documentation for usage, but below is a short example that demonstrates how to obtain an image embedding with either [Pipeline] or the [AutoModel] class.

from transformers import pipeline
from transformers.image_utils import load_image

url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg"
image = load_image(url)

feature_extractor = pipeline(
    model="facebook/dinov3-convnext-tiny-pretrain-lvd1689m",
    task="image-feature-extraction",
)
features = feature_extractor(image)
import torch
from transformers import AutoImageProcessor, AutoModel
from transformers.image_utils import load_image

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = load_image(url)

pretrained_model_name = "facebook/dinov3-convnext-tiny-pretrain-lvd1689m"
processor = AutoImageProcessor.from_pretrained(pretrained_model_name)
model = AutoModel.from_pretrained(
    pretrained_model_name,
    device_map="auto",
)

inputs = processor(images=image, return_tensors="pt").to(model.device)
with torch.inference_mode():
    outputs = model(**inputs)

pooled_output = outputs.pooler_output
print("Pooled output shape:", pooled_output.shape)

where model and pretrained_model_name above can be one of:

Image transforms

For models using the LVD-1689M weights (pretrained on web images), please use the following transform (standard ImageNet evaluation transform):

import torchvision
from torchvision.transforms import v2

def make_transform(resize_size: int = 256):
    to_tensor = v2.ToImage()
    resize = v2.Resize((resize_size, resize_size), antialias=True)
    to_float = v2.ToDtype(torch.float32, scale=True)
    normalize = v2.Normalize(
        mean=(0.485, 0.456, 0.406),
        std=(0.229, 0.224, 0.225),
    )
    return v2.Compose([to_tensor, resize, to_float, normalize])

For models using the SAT-493M weights (pretrained on satellite imagery), please use the following transform:

import torchvision
from torchvision.transforms import v2

def make_transform(resize_size: int = 256):
    to_tensor = v2.ToImage()
    resize = v2.Resize((resize_size, resize_size), antialias=True)
    to_float = v2.ToDtype(torch.float32, scale=True)
    normalize = v2.Normalize(
        mean=(0.430, 0.411, 0.296),
        std=(0.213, 0.156, 0.143),
    )
    return v2.Compose([to_tensor, resize, to_float, normalize])

Pretrained heads - Image classification

Backbone Pretraining
Dataset
Head
Dataset
Download
ViT-7B/16 LVD-1689M ImageNet [link]

The (full) classifier models can be loaded via PyTorch Hub:

import torch

# DINOv3
dinov3_vit7b16_lc = torch.hub.load(REPO_DIR, 'dinov3_vit7b16_lc', source="local", weights=<DEPTHER/CHECKPOINT/URL/OR/PATH>, backbone_weights=<BACKBONE/CHECKPOINT/URL/OR/PATH>)

Pretrained heads - Depther trained on SYNTHMIX dataset

Backbone Pretraining
Dataset
Head
Dataset
Download
ViT-7B/16 LVD-1689M SYNTHMIX [link]
depther = torch.hub.load(REPO_DIR, 'dinov3_vit7b16_dd', source="local", weights=<DEPTHER/CHECKPOINT/URL/OR/PATH>, backbone_weights=<BACKBONE/CHECKPOINT/URL/OR/PATH>)

Full example code of depther on an image

from PIL import Image
import torch
from torchvision.transforms import v2
import matplotlib.pyplot as plt
from matplotlib import colormaps

def get_img():
    import requests
    url = "http://images.cocodataset.org/val2017/000000039769.jpg"
    image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
    return image

def make_transform(resize_size: int | list[int] = 768):
    to_tensor = v2.ToImage()
    resize = v2.Resize((resize_size, resize_size), antialias=True)
    to_float = v2.ToDtype(torch.float32, scale=True)
    normalize = v2.Normalize(
        mean=(0.485, 0.456, 0.406),
        std=(0.229, 0.224, 0.225),
    )
    return v2.Compose([to_tensor, resize, to_float, normalize])

depther = torch.hub.load(REPO_DIR, 'dinov3_vit7b16_dd', source="local", weights=<DEPTHER/CHECKPOINT/URL/OR/PATH>, backbone_weights=<BACKBONE/CHECKPOINT/URL/OR/PATH>)

img_size = 1024
img = get_img()
transform = make_transform(img_size)
with torch.inference_mode():
    with torch.autocast('cuda', dtype=torch.bfloat16):
        batch_img = transform(img)[None]
        batch_img = batch_img
        depths = depther(batch_img)

plt.figure(figsize=(12, 6))
plt.subplot(121)
plt.imshow(img)
plt.axis("off")
plt.subplot(122)
plt.imshow(depths[0,0].cpu(), cmap=colormaps["Spectral"])
plt.axis("off")

Reproduce paper results

Make sure the NYU dataset is setup following this.

Launch the following to reproduce our paper's depth estimation results on NYUv2 with the pretrained Depther trained on SYNTHMIX:

PYTHONPATH=. python -m dinov3.run.submit dinov3/eval/depth/run.py \
config=dinov3/eval/depth/configs/config-nyu-synthmix-dpt-inference.yaml \
datasets.root=<PATH/TO/DATASET> \
load_from=dinov3_vit7b16_dd \
--output-dir <PATH/TO/OUTPUT/DIR>

Notes:

PYTHONPATH=. python dinov3/eval/depth/run.py \
config=dinov3/eval/depth/configs/config-nyu-synthmix-dpt-inference.yaml \
datasets.root=<PATH/TO/DATASET> \
load_from=dinov3_vit7b16_dd \
output_dir=<PATH/TO/OUTPUT/DIR>

Pretrained heads - Detector trained on COCO2017 dataset

Backbone Pretraining
Dataset
Head
Dataset
Download
ViT-7B/16 LVD-1689M COCO2017 [link]
detector = torch.hub.load(REPO_DIR, 'dinov3_vit7b16_de', source="local", weights=<DETECTOR/CHECKPOINT/URL/OR/PATH>, backbone_weights=<BACKBONE/CHECKPOINT/URL/OR/PATH>)

Pretrained heads - Segmentor trained on ADE20K dataset

Backbone Pretraining
Dataset
Head
Dataset
Download
ViT-7B/16 LVD-1689M ADE20K [link]
segmentor = torch.hub.load(REPO_DIR, 'dinov3_vit7b16_ms', source="local", weights=<SEGMENTOR/CHECKPOINT/URL/OR/PATH>, backbone_weights=<BACKBONE/CHECKPOINT/URL/OR/PATH>)

Example command to run a full inference on ADE20K with the provided segmentor (ViT-7B + M2F):

PYTHONPATH=. python -m dinov3.run.submit dinov3/eval/segmentation/run.py \
config=dinov3/eval/segmentation/configs/config-ade20k-m2f-inference.yaml  \
datasets.root=<PATH/TO/DATASET> \
load_from=dinov3_vit7b16_ms \
--output-dir <PATH/TO/OUTPUT/DIR>

Full example code of segmentator on an image

import sys
sys.path.append(REPO_DIR)

from PIL import Image
import torch
from torchvision import transforms
import matplotlib.pyplot as plt
from matplotlib import colormaps
from functools import partial
from dinov3.eval.segmentation.inference import make_inference


def get_img():
    import requests
    url = "http://images.cocodataset.org/val2017/000000039769.jpg"
    image = Image.open(requests.get(url, stream=True).raw).conver

dinov3 (facebookresearch/dinov3)

Searching Database…

11.6K ·GitHub
What is this?Meta AI Research (FAIR)'s reference PyTorch implementation and model release for DINOv3, a family of vision foundation models that produce high-quality dense features and perform strongly across many vision tasks.
So is DINOv3 one model or a whole family?A family: distilled ViT backbones from 21M up to a 6.7B-parameter ViT-7B/16, ConvNeXt backbones from 29M to 198M, plus trained task heads you can download on top of the flagship backbone.
How do I load one of these models in Python?Request the weights via the linked form, then either point torch.hub.load() at the downloaded files (or pass the URL directly) or load a 'facebook/dinov3-*' checkpoint through Hugging Face Transformers 4.56.0+; the timm library also supports the backbones since 1.0.20.
Is plain PyTorch enough, or do I need anything else?PyTorch is the only required dependency for loading a model, and the README strongly recommends installing it with CUDA support. No accounts or API keys beyond the gated weight download.
Is there a catch to getting the weights?Yes, access is gated: you fill in a request form and must wait for an approval e-mail with the download URLs. The README also warns to download the weights with wget rather than a web browser.
What downstream tasks do the released pretrained heads cover?The repo ships heads for image classification on ImageNet, monocular depth estimation (depther trained on SYNTHMIX, evaluated on NYUv2), object detection on COCO2017, and semantic segmentation on ADE20K, plus linear-probing code for segmentation and depth.
What makes the DINOv3 features special?They are high-quality dense features: patch-level cosine similarity maps reveal semantic correspondences between image regions, and the models reportedly beat specialized state-of-the-art systems across a broad range of settings without fine-tuning.
Is there anything in this repo for satellite imagery work?Yes — beyond the SAT-493M backbones, the team released Canopy Height Maps v2 (CHMv2) built on DINOv3, and the FINO branch adds metadata-guided training recipes for satellite (FMoW) and fluorescence (HPA) imagery.
Size
12.6 MB
Stars
11.6K
Updated
CommitJul 15
Age
1y
Commits · 90 Days