Downloads · 30 days
20
3% of all-time downloads
zeromodels/dinov2-giant
dinov2-giant is a image feature extraction model from zeromodels. Use it for the image feature extraction task on the model card, and read the license before you ship it in a product. It is set up for zeromodels. The card lists the license as apache-2.0.
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/dinov2/) [](https://huggingface.co/collections/zeromodels/dino-v1-v2-v3-6a8eaf5a43e1a5079d6cc817)
Downloads · 30 days
20
3% of all-time downloads
All-time downloads
691
Public
Repo size
4.5 GB
Likes
0
Public
Click a slice to open those files.
.h54.5 GB · 100%
From the Hugging Face model README
Paper: DINOv2: Learning Robust Visual Features without Supervision (arXiv:2304.07193) · HF Papers
DINOv2 scales self-supervised ViT pretraining for strong transferable visual features without labels. These checkpoints are backbones that return patch tokens for downstream heads.
The giant (ViT-g/14) is the largest DINOv2 backbone and uses a SwiGLU FFN in place of the GELU MLP.
For more details on the model, please go to the upstream model card.
Pure-Keras 3 conversion of facebook/dinov2-giant for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is a self-supervised backbone (DinoV2Model), not a task head.
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.dino_v2 import DinoV2Model, DinoV2ImageProcessor
# The processor resizes + ImageNet-normalizes, so build the model with
# include_normalization=False (it would otherwise normalize a second time).
model = DinoV2Model.from_weights(
"zeromodels/dinov2-giant", include_normalization=False
)
processor = DinoV2ImageProcessor.from_weights("zeromodels/dinov2-giant")
pixel_values = processor("your_image.jpg")["pixel_values"]
features = model(pixel_values, training=False)
print(pixel_values.shape, features.shape)
Load any DINOv2 variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub | Backbone |
|---|---|---|
dinov2-small | zeromodels/dinov2-small | ViT-S/14 |
dinov2-base | zeromodels/dinov2-base | ViT-B/14 |
dinov2-large | zeromodels/dinov2-large | ViT-L/14 |
dinov2-giant | zeromodels/dinov2-giant | ViT-g/14 |
KERAS_BACKEND before importing Keras / zeromodels.include_normalization=False. To skip it, feed raw [0, 255] pixels and keep the default include_normalization=True.DinoV2Model.from_weights("hf:facebook/dinov2-giant").A huge thank you to the Facebook AI Research DINOv2 authors for creating and releasing these models. License: Apache 2.0.