🍅 Tomato Detector — YOLO26s
Component 1 of the Tomato Ripeness Detection & Counting pipeline. Finds every tomato in a photo or video frame (one class: tomato), whatever its ripeness.

| Architecture | YOLO26s (Ultralytics), 640 px input, NMS-free |
| Trained on | 5,783 images (6 unified public datasets) · validated on 1,073 |
| Recommended confidence | 0.25 (F1-optimal on val: 0.334, see thresholds.json) |
| Size | 20 MB · ~40 ms / image on a T4, ~300 ms on CPU |
Results (images never seen in training)
| Test set | Images | Tomatoes | mAP50 | Recall | Precision |
|---|---|---|---|---|---|
| Tomato Defects test | 86 | 768 | 0.988 | 99.0% | 93.3% |
| tomato-sxsc7 holdout | 57 | 736 | 0.967 | 93.3% | 94.8% |
| Conveyor-belt holdout | 43 | 650 | 0.923 | 84.9% | 90.0% |
mAP50-95 on the Tomato Defects test: 0.919. Misses concentrate on small, far or motion-blurred tomatoes.
Use
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
model = YOLO(hf_hub_download("ParsaVictor/tomato-detector-yolo26s", "detector_yolo26s_best.pt"))
r = model.predict("tomatoes.jpg", conf=0.25)[0]
print(len(r.boxes), "tomatoes")
r.save("result.jpg")
YOLO26 does no NMS; on very dense images a light duplicate filter (IoU > 0.55) helps, as done in the full pipeline.
Related
- 🍅 Full pipeline (detection + ripeness + tracking + counting): ParsaVictor/tomato-ripeness-yolo26
- 🎨 Component 2, ripeness classifier: ParsaVictor/tomato-ripeness-classifier-yolo26s
- 🗂️ Dataset: ParsaVictor/tomato-ripeness-detection
- 💻 Code: github.com/ParsaVictor/tomato-ripeness-detection
License: AGPL-3.0 (Ultralytics). Closed-source commercial use needs an Ultralytics Enterprise license.