Combines YOLO11 detection with multi-object tracking so each fruit is counted exactly once, reporting unique fruit rather than per-frame detections.
git clone https://github.com/felipebridge/fruit-detection-counting.git
cd fruit-detection-counting
pip install -e .
fruit-counter # processes every video in videos_to_processing/Results go to outputs/<video>_<timestamp>/: an annotated H.264 video, summary.json and frames.csv.
Install ffmpeg for H.264 output with audio.
fruit-counter -i fruit_bowl.jpg # image or folder
fruit-counter -i orchard.mp4 --device cuda:0 # video on a GPU
fruit-counter -i 0 --show # webcam
fruit-counter -i video.mp4 --weights my_model.pt # your own modelSettings live in configs/default.yaml; see fruit-counter --help.
Detect (YOLO11, class-agnostic NMS) → Track (constant-velocity + Hungarian IoU matching) → Count (once per confirmed track, label by confidence-weighted vote) → Render.
MIT © felipebridge. Powered by Ultralytics YOLO (AGPL-3.0). Contributions welcome, see CONTRIBUTING.md.
