Automated Garbage Detection and Alert System for Post Offices using YOLOv5
CleanVision is a computer vision-based system developed during the Smart India Hackathon (SIH) to automate cleanliness monitoring across post office premises. It uses a custom-trained YOLOv5 model to detect garbage in surveillance footage, trigger real-time alerts, and display actionable insights via an interactive dashboard.
The project aims to ensure hygiene, transparency, and accountability within postal divisions.
๐ GitHub Repo: https://github.com/dopTrashTrackers/website.git
- โ๏ธ Garbage Detection using YOLOv5
- ๐ต๏ธ Tracks Garbage Across Frames
- ๐ฉ Real-time Alerts via SMS & Email (Twilio)
- ๐ Dashboard to Monitor Cleanliness and Compliance
- ๐ Ranks Post Offices Based on Performance
- ๐ฅ Community Awareness and Engagement Section
graph TD
A[CCTV Feed] --> B(Frame Capture)
B --> C{YOLOv5 Detection}
C -->|Garbage Found| D[Track Persistence]
C -->|Clean| B
D --> E{Exceeds Threshold?}
E -->|Yes| F[Trigger Alerts]
E -->|No| B
F --> G[Dashboard Update]
G --> H[Compliance Verification]
- Surveillance footage is captured from static CCTV cameras installed at post office premises.
- The video stream is processed into frames using OpenCV, resized, and prepared as input for the YOLOv5 model.
- The YOLOv5 model processes each image frame to detect garbage items like bottle caps, paper boxes, cigarette butts, and plastic.
- Each frame is divided into grid cells where bounding box coordinates, confidence scores, and object classes are predicted.
- Non-Maximum Suppression (NMS) removes overlapping boxes, retaining only the highest-confidence detections.
- On first-time sign-up, users must download a Python script named
Launch AI Model.pyfrom the dashboard. - When executed, the script:
- Captures or accepts an image input
- Runs the YOLOv5 model locally
- Returns detection results
๐ก๏ธ This design ensures model execution is performed locally, avoiding real-time hosting, enhancing privacy and reducing infrastructure costs.
- Garbage is tracked across frames using bounding boxes and size measurement.
- If garbage persists and exceeds a predefined threshold:
- An automated alert is triggered.
- Twilio SMS and Email are sent to divisional officers and cleaning staff.
- Includes a proof-submission link for uploading a cleaned image post-action.
- Dashboard updates in real-time with compliance status.
Built using React.js, the dashboard offers a dynamic, real-time view of activity.
- Bar Chart โ Frequency of different garbage types.
- Line Chart โ Trends of garbage detection over time.
- Pie Chart โ Compliance scores per post office.
- Tabular View โ Timestamped list of detection events.
- An interactive map highlights top and bottom performers based on compliance scores.
- Showcases cleanliness drives, awareness programs, and encourages community involvement.
- Ranks each post office based on:
- โฑ๏ธ Response time to alerts
- ๐งน Participation in community programs
- ๐ Frequency of garbage detections
| Layer | Tools |
|---|---|
| Frontend | React.js, HTML, CSS, Recharts |
| Backend | Flask, Firebase (Authentication & Storage) |
| Notifications | Twilio API (SMS & Email) |
| Mapping & Charts | React Leaflet (Map), Recharts |
git clone https://github.com/dopTrashTrackers/website.git
cd websiteMake sure you have Node.js and npm installed. Then, install all frontend packages and start the development server:
npm install # Installs all frontend dependencies
npm run dev # Starts the React development server (Vite)CleanVision uses a YOLOv5 model to detect garbage from captured images. For privacy and efficiency, the model runs locally on your machine.
Download the Python script named: Launch AI Model
Make sure you have the following installed on your system:
- Python 3.7+
- YOLOv5 repository and its dependencies
- OpenCV
- PyTorch
- Other dependencies:
numpy,Pillow,matplotlib
You can install everything using:
pip install -r requirements.txtIf requirements.txt is not available, install dependencies manually:
pip install torch torchvision torchaudio
pip install opencv-python numpy matplotlib pillow
Step C: Run the Script Execute the downloaded Python script in your terminal:
python "Launch AI Model.py"
We welcome contributions to improve CleanVision! Follow the steps below to get started:
Click the Fork button at the top-right of this page to create your own copy of the repository.
git checkout -b feature/your-feature-nameEdit the codebase as needed and commit your changes:
git commit -m "Added new feature"
๐ Step 4: Push to Your Fork
git push origin feature/your-feature-name
๐ฅ Step 5: Create a Pull Request
Open a Pull Request from your forked repository back to the main branch of the original project.
๐ Finalist โ Smart India Hackathon 2024
๐งน Inspired by the Swachh Bharat Mission
| ๐ Web & Dashboard Development | ๐ค AI/ML Model Development |
|---|---|
| Souvik Maity | Nidhi Satyapriya |
| Abhijeet Awasthi | Rahul Kumar |
| Shraddha Sahu | |
| Shiekh Mahammad Arzu |