Instructions to use dima806/farm_insects_image_detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dima806/farm_insects_image_detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="dima806/farm_insects_image_detection") 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("dima806/farm_insects_image_detection") model = AutoModelForImageClassification.from_pretrained("dima806/farm_insects_image_detection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| license: apache-2.0 | |
| metrics: | |
| - accuracy | |
| - f1 | |
| base_model: | |
| - google/vit-base-patch16-224-in21k | |
| Returns farm insect type given an image with about 91% accuracy. | |
| See https://www.kaggle.com/code/dima806/farm-insects-image-detection-vit for more details. | |
| ``` | |
| Classification report: | |
| precision recall f1-score support | |
| Fall Armyworms 0.7895 0.3191 0.4545 47 | |
| Western Corn Rootworms 0.9787 0.9787 0.9787 47 | |
| Colorado Potato Beetles 1.0000 0.9792 0.9895 48 | |
| Thrips 0.9762 0.8723 0.9213 47 | |
| Corn Earworms 0.9070 0.8125 0.8571 48 | |
| Cabbage Loopers 0.9388 0.9583 0.9485 48 | |
| Armyworms 0.6143 0.9149 0.7350 47 | |
| Brown Marmorated Stink Bugs 1.0000 1.0000 1.0000 48 | |
| Tomato Hornworms 0.9792 1.0000 0.9895 47 | |
| Citrus Canker 0.9038 1.0000 0.9495 47 | |
| Aphids 0.9020 0.9583 0.9293 48 | |
| Corn Borers 0.8148 0.9167 0.8627 48 | |
| Fruit Flies 1.0000 1.0000 1.0000 48 | |
| Africanized Honey Bees (Killer Bees) 1.0000 1.0000 1.0000 48 | |
| Spider Mites 0.9167 0.9167 0.9167 48 | |
| accuracy 0.9090 714 | |
| macro avg 0.9147 0.9085 0.9022 714 | |
| weighted avg 0.9151 0.9090 0.9027 714 | |
| ``` |