Skip to content

BlankJus/garbage_sort

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

♻️ Garbage Sorting Robot with YOLOv5n-garbage

This demo showcases an automated waste sorting system using artificial intelligence. The system captures real-time images from a camera, identifies the type of waste using the YOLOv5n-garbage model, and controls a servomotor on a Raspberry Pi for physical sorting. Images are saved in both raw form and with annotations for later verification.

✅ Project Structure

/
├── src/
│   ├── model.py     # Loads the model and detection function
│   ├── control.py   # Servo control (RPi.GPIO)
│   └── main.py      # Main logic: capture, detection, control
├── data/
│   ├── input/       # Raw input images
│   └── output/      # Images with drawn predictions
├── weights/
│   └── best.pt      # Trained model weights
├── yolov5/          # YOLOv5 source code (cloned from GitHub)
├── requirements.txt # List of required packages
└── README.md        # Project documentation

🖼️ Prediction Examples

Test images with actual results from the YOLOv5n-garbage model:

Example 1 Example 2 Example 3

📋 Requirements

  • Python > 3.7
  • Raspberry Pi or other camera-compatible device
  • Minimum 1 GB free RAM
  • Connected and properly configured camera

⚙️ Installation

1. Clone the project

git clone https://github.com/Bahna-Darius/garbage_sort
cd garbage_sort

2. Clone the YOLOv5 repository

git clone https://github.com/ultralytics/yolov5.git

3. Create a virtual environment and install dependencies

python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt

🚀 Running the Demo

python src/main.py

📝 Usage Notes

  • Make sure the camera is connected and functional before running
  • Adequate lighting significantly improves detection accuracy
  • Check the data/output folder for processed images and results

🔧 Troubleshooting

  • Camera error: Check device connection and permissions
  • Servo problem: Ensure GPIO pins are properly configured
  • Poor detection: Adjust lighting and object positioning

📚 Resources

📄 License

This project is distributed under a Personal License. See the LICENSE file for details.

Author

This project was created and is maintained by Bahna Darius. You can find me on LinkedIn.

About

Waste-Sorting Robot Demo: initial YOLOv5-powered prototype for real-time garbage classification and servo control.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 63.3%
  • Python 36.7%