AI-Lab-Makerere/beans
Viewer • Updated • 1.3k • 7.1k • 47
How to use Wadden/vit-beans-demo with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-classification", model="Wadden/vit-beans-demo")
pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png") # Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("Wadden/vit-beans-demo")
model = AutoModelForImageClassification.from_pretrained("Wadden/vit-beans-demo", device_map="auto")Fine-tuned google/vit-base-patch16-224-in21k on the official
beans dataset for 4 epochs. It classifies bean leaves as
angular_leaf_spot, bean_rust, or healthy.
| Metric | Value |
|---|---|
| Accuracy | 0.9609 |
from transformers import pipeline
classifier = pipeline("image-classification", model="Wadden/vit-beans-demo")
classifier("leaf.jpg")
The quantized ONNX export is executed directly in the browser with Transformers.js: