facebookresearch/dino is an open-source project on GitHub with 7.6k stars, written primarily in Python. PyTorch code for Vision Transformers training with the Self-Supervised learning method DINO
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
:new: Please check out our more recent DINOv2 effort in the same line of work.
Self-Supervised Vision Transformers with DINO
PyTorch implementation and pretrained models for DINO. For details, see Emerging Properties in Self-Supervised Vision Transformers.
[blogpost] [arXiv] [Yannic Kilcher's video]
Pretrained models
You can choose to download only the weights of the pretrained backbone used for downstream tasks, or the full checkpoint which contains backbone and projection head weights for both student and teacher networks. We also provide the backbone in onnx format, as well as detailed arguments and training/evaluation logs. Note that DeiT-S and ViT-S names refer exactly to the same architecture.
arch
params
k-nn
linear
download
ViT-S/16
21M
74.5%
77.0%
backbone only
full ckpt
onnx
args
logs
eval logs
ViT-S/8
21M
78.3%
79.7%
backbone only
full ckpt
onnx
args
logs
eval logs
ViT-B/16
85M
76.1%
78.2%
backbone only
full ckpt
onnx
args
logs
eval logs
ViT-B/8
85M
77.4%
80.1%
backbone only
full ckpt
onnx
args
logs
eval logs
ResNet-50
23M
67.5%
75.3%
backbone only
full ckpt
onnx
args
logs
eval logs
We also release XCiT models ([arXiv] [code]) trained with DINO:
Please install PyTorch and download the ImageNet dataset. This codebase has been developed with python version 3.6, PyTorch version 1.7.1, CUDA 11.0 and torchvision 0.8.2. The exact arguments to reproduce the models presented in our paper can be found in the args column of the pretrained models section. For a glimpse at the full documentation of DINO training please run:
python main_dino.py --help
Vanilla DINO training :sauropod:
Run DINO with ViT-small network on a single node with 8 GPUs for 100 epochs with the following command. Training time is 1.75 day and the resulting checkpoint should reach 69.3% on k-NN eval and 74.0% on linear eval. We provide training and linear evaluation logs (with batch size 256 at evaluation time) for this run to help reproducibility.
The resulting pretrained model should reach 73.3% on k-NN eval and 76.0% on linear eval. Training time is 2.6 days with 16 GPUs. We provide training and linear evaluation logs (with batch size 256 at evaluation time) for this run to help reproducibility.
ResNet-50 and other convnets trainings
This code also works for training DINO on convolutional networks, like ResNet-50 for example. We highly recommend to adapt some optimization arguments in this case. For example following is a command to train DINO on ResNet-50 on a single node with 8 GPUs for 100 epochs. We provide training logs and final checkpoint for this run.
If you choose not to specify --pretrained_weights, then DINO reference weights are used by default. If you want instead to evaluate checkpoints from a run of your own, you can run for example:
Evaluation: Image Retrieval on revisited Oxford and Paris
Step 1: Prepare revisited Oxford and Paris by following this repo.
Step 2: Image retrieval (if you do not specify weights with --pretrained_weights then by default DINO weights pretrained on Google Landmark v2 dataset will be used).
Step 2 (opt): Prepare a set of image distractors and a set of images on which to learn the whitening operator.
In our paper, we use 10k random images from YFCC100M as distractors and 20k random images from YFCC100M (different from the distractors) for computing the whitening operation.
We report result on the strong subset. For example in the stdout from the command above we get: eval on strong mAP=0.858.
License
This repository is released under the Apache 2.0 license as found in the LICENSE file.
Citation
If you find this repository useful, please consider giving a star :star: and citation :t-rex::
@inproceedings{caron2021emerging,
title={Emerging Properties in Self-Supervised Vision Transformers},
author={Caron, Mathilde and Touvron, Hugo and Misra, Ishan and J\'egou, Herv\'e and Mairal, Julien and Bojanowski, Piotr and Joulin, Armand},
booktitle={Proceedings of the International Conference on Computer Vision (ICCV)},
year={2021}
}
How active is development on facebookresearch/dino?
The most recent commit recorded on facebookresearch/dino was 2.4 years ago, based on the GitHub push timestamp. The repository has 1.1k forks — one of the better signals of community interest.
How many stars does facebookresearch/dino have?
facebookresearch/dino has 7.6k GitHub stars — refresh the page for the live number, or check github.com/facebookresearch/dino. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is facebookresearch/dino open source?
Yes — facebookresearch/dino ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/facebookresearch/dino.
What is facebookresearch/dino?
facebookresearch/dino (facebookresearch/dino) is a Python project on GitHub. From the project's own README: PyTorch code for Vision Transformers training with the Self-Supervised learning method DINO
Where do I read more about facebookresearch/dino?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/facebookresearch/dino is the definitive source.
Read full README in the tab above.
Is dino worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of dino.