AI-Lab-Makerere/beans
Viewer • Updated • 1.3k • 9.16k • 47
How to use t7hom/vit-beans-classifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-classification", model="t7hom/vit-beans-classifier")
pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("t7hom/vit-beans-classifier")
model = AutoModelForImageClassification.from_pretrained("t7hom/vit-beans-classifier", device_map="auto")