Downloads · 30 days
28
13% of all-time downloads
yvelos/beit-food-384
beit-food-384 is a image classification model from yvelos. Use it when you need a label for an image. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
28
13% of all-time downloads
All-time downloads
214
Public
Parameters
86.3M
345 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors345 MB · 100%
From the Hugging Face model README
This model is a fine-tuned BEiT image encoder for food image classification, trained on a merged dataset combining three major datasets:
It predicts 409 food classes, including fruits, vegetables, pastries, soups, desert etc.
microsoft/beit-base-patch16-384Use alongside:
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
import torch
processor = AutoImageProcessor.from_pretrained("your-username/your-model")
model = AutoModelForImageClassification.from_pretrained("your-username/your-model")
img = Image.open("example.jpg")
inputs = processor(img, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
pred = outputs.logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[pred])