Downloads · 30 days
94
47% of all-time downloads
Mustafa5645344/insect-detection-yolov8
insect-detection-yolov8 is a object detection model from Mustafa5645344. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as mit.
This repository provides production-ready YOLOv8m (Medium) weights fine-tuned on 50,000 augmented agricultural images (specifly-3-rwm7i) for real-time localization and detection of insect pests in fields and greenhouses.
Downloads · 30 days
94
47% of all-time downloads
All-time downloads
199
Public
Repo size
46.8 MB
Likes
0
Public
Click a slice to open those files.
.pt46.8 MB · 100%
From the Hugging Face model README
This repository provides production-ready YOLOv8m (Medium) weights fine-tuned on 50,000 augmented agricultural images (specifly-3-rwm7i) for real-time localization and detection of insect pests in fields and greenhouses.
| Insect Class | Images | Instances | Precision (P) | Recall (R) | mAP@50 | mAP@50-95 |
|---|---|---|---|---|---|---|
| All Classes | 2,987 | 3,097 | 0.835 | 0.816 | 0.854 | 0.519 |
stem_borer | 206 | 223 | 0.957 | 0.978 | 0.992 | 0.794 |
leafhopper | 208 | 216 | 0.942 | 0.949 | 0.976 | 0.681 |
ladybug | 174 | 177 | 0.954 | 0.977 | 0.976 | 0.622 |
dragonfly | 18 | 18 | 0.903 | 0.944 | 0.959 | 0.662 |
butterfly | 186 | 222 | 0.915 | 0.918 | 0.950 | 0.629 |
weevil | 58 | 61 | 0.889 | 0.934 | 0.946 | 0.521 |
rice_bug | 190 | 237 | 0.931 | 0.916 | 0.937 | 0.595 |
bees | 211 | 236 | 0.887 | 0.915 | 0.920 | 0.551 |
mole_cricket | 39 | 41 | 0.882 | 0.854 | 0.890 | 0.471 |
grasshopper | 298 | 317 | 0.882 | 0.852 | 0.885 | 0.510 |
planthopper | 116 | 429 | 0.815 | 0.855 | 0.872 | 0.471 |
spider | 72 | 78 | 0.767 | 0.821 | 0.858 | 0.572 |
ant | 71 | 173 | 0.733 | 0.761 | 0.813 | 0.373 |
cicada | 55 | 78 | 0.808 | 0.744 | 0.797 | 0.423 |
caterpillar | 173 | 208 | 0.853 | 0.716 | 0.791 | 0.400 |
stink_bug | 123 | 123 | 0.727 | 0.724 | 0.777 | 0.535 |
aphid | 36 | 163 | 0.686 | 0.632 | 0.669 | 0.332 |
mantis | 96 | 97 | 0.493 | 0.206 | 0.361 | 0.202 |
specifly-3-rwm7i (Augmented Version)from ultralytics import YOLO
from huggingface_hub import hf_hub_download
# Download best weights
weights_path = hf_hub_download(
repo_id="Mustafa5645344/insect-detection-yolov8",
filename="best.pt"
)
# Run Inference
model = YOLO(weights_path)
results = model.predict(source="field_sample.jpg", conf=0.35, save=True)
for r in results:
for box in r.boxes:
cls_id = int(box.cls[0].item())
conf = float(box.conf[0].item())
print(f"Found: {model.names[cls_id]} with {conf*100:.1f}% confidence")