AI-Lab-Makerere/beans
Viewer • Updated • 1.3k • 9.46k • 48
How to use lustachowicz/beans-vit with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-classification", model="lustachowicz/beans-vit")
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("lustachowicz/beans-vit")
model = AutoModelForImageClassification.from_pretrained("lustachowicz/beans-vit", device_map="auto")google/vit-base-patch16-224 fine-tuned on AI-Lab-Makerere/beans
(bean-leaf disease classification) for Lab 1 of Przetwarzanie Danych w Chmurze.
Classes: angular_leaf_spot, bean_rust, healthy
| class | precision | recall | f1-score | support |
|---|---|---|---|---|
| angular_leaf_spot | 1 | 0.9302 | 0.9639 | 43 |
| bean_rust | 0.9149 | 1 | 0.9556 | 43 |
| healthy | 1 | 0.9762 | 0.988 | 42 |
Epochs: 3, learning rate: 5e-05, batch size: 32, fp16 on a Colab T4. Experiments tracked with MLflow.
from transformers import pipeline
clf = pipeline("image-classification", model="lustachowicz/beans-vit")
clf("leaf.jpg", top_k=3)
Base model
google/vit-base-patch16-224