Real-time fruit detection powered by YOLOv8, using a custom fruit dataset split into train/val/test.
Built for quick deployment and clean reproducibility.
- π§ YOLOv8n model trained on a custom fruit dataset from Roboflow
- π§© Custom Split: dataset manually divided into train, val, and test sets
- π― Pretrained Weights: runs directly using
best.ptwithout retraining - π» Simple Interface: just run one Python file - no complex setup needed
The full essay report has been uploaded to Google Drive.
You can access it here π
π Download Essay Report
The dataset contains 6 fruit classes used for object detection:
| Class | Description |
|---|---|
| π Pineapple | Tropical fruit with spiky skin and sweet yellow flesh. |
| π Cherry | Small red fruit often appearing in pairs. |
| π₯ Mango | Yellow-orange fruit with smooth skin and sweet aroma. |
| π Plum | Round fruit with smooth skin, purple or red when ripe. |
| π Tomato | Red juicy fruit often mistaken for a vegetable. |
| π Watermelon | Large green fruit with red interior and black seeds. |
Fruits-Detection/
βββ program.py # Main entry point for running detection
βββ requirements.txt # Python dependencies
βββ LICENSE
βββ SECURITY.md
β
βββ weights/
β βββ best.pt # Trained YOLOv8 model weights
β βββ last.pt
β
βββ dataset_fruits/
βββ data.yaml # Dataset configuration for YOLOv8
βββ README.dataset.md # Info on dataset source & how val set was created
βββ README.roboflow.txt # Original Roboflow export metadata (source information)
βββ train/ # Training images & labels
βββ valid/ # Validation images & labels
βββ test/ # Test images & labelsgit clone https://github.com/quan831/Fruit-Detection.git
cd Fruit-Detectionpython -m venv venv
# Activate:
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activatepip install -r requirements.txtpython program.pyMake sure your working directory includes:
weights/best.ptdataset_fruits/data.yaml
The program loads the YOLOv8 model and runs inference directly.
- Open Anaconda Navigator β Launch Spyder
- Open
program.py - Hit Run (F5) to start detection
- Check outputs and logs inside the console or generated output folder (if any)
- Model:
best.pt(trained YOLOv8n) - Framework: Ultralytics YOLOv8 (Python)
- Dataset: Custom split version of Roboflow fruit dataset
- Train/Val/Test Ratio: defined manually in
README.dataset.md
This project is licensed under the MIT License.
See SECURITY.md for details on responsible disclosure.
- Ultralytics YOLOv8
- Roboflow for dataset hosting
- Original dataset: nhαΊn diα»n trΓ‘i cΓ’y v2 Computer Vision Dataset
- Custom dataset split and model tuning by Quan (James)
If this repo helps you, please give it a β on GitHub - it really motivates me!
- Nguyα» n Minh QuΓ’n (Leader)
- HoΓ ng Quα»c KhΓ‘nh
- LΓͺ HoΓ ng Lan
- Triα»u YαΊΏn Vi

