mnjm's picture
Upload folder using huggingface_hub
31cea46 verified
|
Raw
History Blame Contribute Delete
904 Bytes
---
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]
```