Fruit & Vegetable Object Detector (YOLOv8n)
Fine-tuned YOLOv8n for detecting and counting fruits and vegetables in images.
Model Details
- Base model: yolov8n.pt (Ultralytics)
- Task: Object detection (bounding box + class)
- Classes ({len(class_names)}): {class_list_str}
- Input size: 640x640
- Framework: Ultralytics YOLOv8
Training
- Fine-tuned for 26 epochs (early stopped, patience=10, best at epoch 16)
- mAP50: 0.877
- mAP50-95: 0.653
- Precision: 0.809, Recall: 0.83
Usage
from ultralytics import YOLO
model = YOLO("best.pt")
results = model.predict("your_image.jpg", conf=0.25)
for box in results[0].boxes:
cls_name = model.names[int(box.cls[0])]
conf = float(box.conf[0])
print(f"{cls_name}: {conf:.2f}")