Downloads · 30 days
8
3% of all-time downloads
Misupatel/vit-imagenette
vit-imagenette is a image classification model from Misupatel. Use it when you need a label for an image. It is set up for transformers. The card lists the license as apache-2.0.
Fine-tuned from google/vit-base-patch16-224 on the Imagenette 160 px dataset.
Downloads · 30 days
8
3% of all-time downloads
All-time downloads
240
Public
Parameters
85.8M
343 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors343 MB · 100%
From the Hugging Face model README
Fine-tuned from google/vit-base-patch16-224
on the Imagenette 160 px dataset.
| Metric | Value |
|---|---|
| Val accuracy | 99.52% |
| Val loss | 0.017721 |
| Best epoch | 9 |
| Classes | 10 |
tench, English springer, cassette player, chain saw, church, French horn, garbage truck, gas pump, golf ball, parachute
from transformers import AutoModelForImageClassification, ViTImageProcessor
from PIL import Image
import torch
model = AutoModelForImageClassification.from_pretrained("Misupatel/vit-imagenette")
processor = ViTImageProcessor.from_pretrained("Misupatel/vit-imagenette")
model.eval()
image = Image.open("your_image.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class = model.config.id2label[logits.argmax(-1).item()]
print(predicted_class)