Downloads · 30 days
6
11% of all-time downloads
whis-22/bankai-image
bankai-image is a image classification model from whis-22. Use it when you need a label for an image. The card lists the license as mit.
This is a fine-tuned Vision Transformer (ViT) model for food image classification.
Downloads · 30 days
6
11% of all-time downloads
All-time downloads
54
Public
Parameters
85.9M
344 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors344 MB · 100%
From the Hugging Face model README
This is a fine-tuned Vision Transformer (ViT) model for food image classification.
This model is intended for classifying food images into various food categories.
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
import torch
processor = AutoImageProcessor.from_pretrained("whis-22/bankai-image")
model = AutoModelForImageClassification.from_pretrained("whis-22/bankai-image")
# Load and preprocess the image
image = Image.open("path_to_your_image.jpg")
inputs = processor(images=image, return_tensors="pt")
# Get predictions
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
# Get the predicted class
print(f"Predicted class: {model.config.id2label[predicted_class_idx]}")