Image Feature Extraction
Transformers
Safetensors
vit
dino
self-supervised
vision-transformer
food101
Instructions to use mnjm/DINOv1-ViT-S-16-food101 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mnjm/DINOv1-ViT-S-16-food101 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="mnjm/DINOv1-ViT-S-16-food101")# Load model directly from transformers import AutoImageProcessor, AutoModel processor = AutoImageProcessor.from_pretrained("mnjm/DINOv1-ViT-S-16-food101") model = AutoModel.from_pretrained("mnjm/DINOv1-ViT-S-16-food101", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| library_name: transformers | |
| pipeline_tag: image-feature-extraction | |
| tags: | |
| - dino | |
| - self-supervised | |
| - vision-transformer | |
| - food101 | |
| datasets: | |
| - ethz/food101 | |
| # DINOv1-ViT-S-16-food101 | |
| DINOv1 ViT-S/16 model trained from scratch on the Food-101 dataset using a custom training [repo](https://github.com/mnjm/dino). | |
| ## Evaluation | |
| Weighted k-NN evaluation on Food-101 validation features: | |
| | k | Top-1 accuracy | Top-5 accuracy | | |
| | --- | --- | --- | | |
| | 5 | 64.09% | 79.93% | | |
| | 10 | 66.38% | 83.47% | | |
| | 20 | 67.59% | 86.17% | | |
| | 100 | 67.81% | 88.72% | | |
| ## Run | |
| ```python | |
| from transformers import AutoImageProcessor, ViTModel | |
| processor = AutoImageProcessor.from_pretrained("mnjm/DINOv1-ViT-S-16-food101") | |
| model = ViTModel.from_pretrained("mnjm/DINOv1-ViT-S-16-food101") | |
| inputs = processor(images=image, return_tensors="pt") | |
| outputs = model(**inputs) | |
| image_features = outputs.last_hidden_state[:, 0] | |
| ``` | |