Downloads · 30 days
0
sefaburak/dinov2-small-onnx
dinov2-small-onnx is a feature extraction model from sefaburak. Use it when you need embeddings to search or compare text. The card lists the license as apache-2.0.
Vision Transformer (ViT) model trained using the DINOv2 method. It was introduced in the paper DINOv2: Learning Robust Visual Features without Supervision by Oquab et al. and first released in this repository. The mod…
Downloads · 30 days
0
Access
Public
Updated Jan 7, 2024
Repo size
86.6 MB
Likes
2
Public
Click a slice to open those files.
.onnx86.6 MB · 100%
From the Hugging Face model README
Vision Transformer (ViT) model trained using the DINOv2 method. It was introduced in the paper DINOv2: Learning Robust Visual Features without Supervision by Oquab et al. and first released in this repository. The model has been exported to ONNX format.
The Vision Transformer (ViT) is a transformer encoder model (BERT-like) pretrained on a large collection of images in a self-supervised fashion.
Images are presented to the model as a sequence of fixed-size patches, which are linearly embedded. One also adds a [CLS] token to the beginning of a sequence to use it for classification tasks. One also adds absolute position embeddings before feeding the sequence to the layers of the Transformer encoder.
Note that this model does not include any fine-tuned heads.
By pre-training the model, it learns an inner representation of images that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled images for instance, you can train a standard classifier by placing a linear layer on top of the pre-trained encoder. One typically places a linear layer on top of the [CLS] token, as the last hidden state of this token can be seen as a representation of an entire image.
Model Properties:
You can use the ONNX model for feature extraction using ONNXRuntime.
Models can be executed using ONNXRuntime. Example usage can be found in the dinov2_onnx repository.
git clone [email protected]:sefaburakokcu/dinov2_onnx.git
cd dinov2_onnx
python onnx_inference.py
Optional arguments:
--onnx_model: Path to the ONNX model file (default: ./dinov2_vits14.onnx).--image_folder: Path to the folder containing input images (default: ./inputs/).misc{oquab2023dinov2,
title={DINOv2: Learning Robust Visual Features without Supervision},
author={Maxime Oquab and Timothée Darcet and Théo Moutakanni and Huy Vo and Marc Szafraniec and Vasil Khalidov and Pierre Fernandez and Daniel Haziza and Francisco Massa and Alaaeldin El-Nouby and Mahmoud Assran and Nicolas Ballas and Wojciech Galuba and Russell Howes and Po-Yao Huang and Shang-Wen Li and Ishan Misra and Michael Rabbat and Vasu Sharma and Gabriel Synnaeve and Hu Xu and Hervé Jegou and Julien Mairal and Patrick Labatut and Armand Joulin and Piotr Bojanowski},
year={2023},
eprint={2304.07193},
archivePrefix={arXiv},
primaryClass={cs.CV}
}