Waste Management Optimizer is a web application designed to plan and visualize optimized waste collection routes. It uses geospatial tools, real-time height data, and a sleek UI to support environmentally conscious waste disposal.
- Overview
- System Architecture
- Key Features
- Technology Stack
- Installation & Setup
- Usage Guide
- API Documentation
- Project Deliverables
- Future Enhancements
- License
This is a project that can be used to manage waste by combining IoT, Digital-platforms and AI. This improves the planning and monitoring of waste in a city with optimized routes, reports from citizens and even gas detection for bins containing dangerous material. This allows the trash collectors to be able to categorize the wastes
- Geospatial Intelligence: Leverages OpenRouteService for multi-point optimization
- Computer Vision: Detectron2 framework for accurate dumpsite detection
- Interactive Mapping: Real-time visualization using Leaflet.js
- Database Integration: SQLite for user management and location storage
- Dumpsite Recognition: Automated detection using trained Detectron2 models
- Image Processing: OpenCV integration for preprocessing and analysis
- Custom Training: Ability to retrain models with new datasets
- Multi-point Routing: Optimized paths through multiple collection points
- Walking Route Planning: Foot-walking profile optimization
- Real-time Calculations: Distance and time estimation
- Interactive Visualization: Dynamic map updates with route overlays
- Responsive Design: TailwindCSS for mobile-first approach
- Interactive Maps: Leaflet.js with custom markers and layers
- User Authentication: Secure login system with Flask sessions
- Database Integration: Location and sensor data management
Frontend | HTML5, TailwindCSS, Leaflet.js | Interactive user interface |
Backend | Flask (Python), Jinja2 | Web framework and templating |
AI/ML | Detectron2, PyTorch, OpenCV | Computer vision and detection |
Geospatial | OpenRouteService API | Routing and optimization |
Mapping | OpenStreetMap, Leaflet tiles | Base mapping services |
Database | SQLite | Data persistence |
Authentication | Flask Sessions, Werkzeug Security | User management |
Environment | Python 3.8+, Virtual Environment | Development setup |
- Python 3.8 or higher
- Git
- Virtual environment support
- Internet connection for API access
======= pip install .
This project integrates the Detectron2 object detection framework into a Flask web application for detecting dumpsites. If you're cloning this repository for the first time, follow the steps below to set up your environment.
Detectron2 must be installed from source:
Ensure your system meets the requirements for PyTorch and OpenCV.
Note: Get your free OpenRouteService API key from heigit.org
Edit the pathway inside resize.py if your data is in a different location.
This will create an output/ folder in detectron. Move it to the upper layer of the folder so that Flask can easily access it.
Important:
- The trained model weights (model_final.pth) are not included due to GitHub's 100MB limit
- You'll need to train the model or obtain pre-trained weights
- Ensure your dataset follows COCO-style annotations
- use of sqlite-cloud to allow communication between the IoT bins , webapp and Mobile-app
Navigate to http://127.0.0.1:5000 to access the application.
- Authentication: Register or login to access the system
- Dashboard: Access the main dashboard with navigation options
- Route Planning: Automatic route generation from database locations via /get_locations
- Dumpsite Detection: Upload satellite images for AI-powered analysis
- Data Management: View reports, sensor data, and location information
- /auth/register - User registration
- /auth/login - User authentication
- /get_locations - Automatic route from database locations
- /dumpsite - AI-powered dumpsite detection
- /report - View system reports
- /sensor - Monitor sensor data
- /locations - Manage location data
Returns: HTML template with route visualization using Jinja2 templating
Returns: HTML template with detection results rendered via Jinja2
Returns: HTML template with database reports using Jinja2
Returns: HTML template displaying sensor information
Returns: HTML template with location data from database
Note: All endpoints return HTML responses rendered through Jinja2 templating engine, not JSON APIs.
This project fulfills all competition requirements:
- Deployment: Fully functional web application
- Features: All core functionality implemented and tested
- Database: SQLite integration for data persistence
- Authentication: Secure user management system
- Implementation: Complete Flask application with AI integration
- Database Schema: User management and location storage
- API Design: Flask endpoints with HTML responses
- Testing: Functional application ready for deployment
- Database Migration: PostgreSQL with PostGIS for production
- API Enhancement: JSON API endpoints alongside HTML responses
- Performance Optimization: Caching and query optimization
- Leaflet.js Documentation - Interactive mapping library
- Detectron2 Documentation - AI detection framework
- Flask Documentation - Web framework
- OpenRouteService API - Routing services
- TailwindCSS Documentation - Utility-first CSS
This project is licensed under the MIT License - see the LICENSE file for details.
Project Repository: https://github.com/mtendekuyokwa19/gaiathon
Built for sustainable waste management and environmental protection