UrbanFlow is a smart traffic light management system designed to prioritize emergency vehicles and optimize traffic flow. The system uses real-time data, machine learning, and the Google Maps API to enhance urban traffic efficiency.
UrbanFlow is an innovative traffic management solution that integrates live traffic signal data and GPS information from emergency vehicles to dynamically adjust traffic lights. The system uses a priority algorithm to ensure emergency vehicles receive the necessary priority at intersections, reducing response times and improving traffic flow.
The project includes a Voluntary Data Collector, which allows users to submit their GPS data voluntarily, enriching the dataset used for traffic analysis and prediction. This additional data source enhances the accuracy and reliability of the UrbanFlow system by providing a broader view of traffic patterns.
- Real-Time Traffic Data Collection: Collects live traffic signal status and GPS data every 30 seconds.
- Voluntary Data Collection: Utilizes the Voluntary Data Collector app to gather additional GPS data from users, increasing the robustness of traffic predictions.
- Priority Management: Assigns dynamic priority scores to vehicles based on type and proximity to intersections.
- Machine Learning Integration: Predicts vehicle routes using historical and real-time data.
- Google Maps API: Utilizes Maps API for accurate ETA calculations and route predictions.
- Traffic Signal Optimization: Automatically updates and manages traffic signals based on processed data.
- User-Friendly Interface: Mobile application for emergency vehicle drivers with real-time updates and notifications.
- Scalable Architecture: Supports high volumes of data with robust performance monitoring and load balancing.
The UrbanFlow system consists of several key components:
- UrbanFlow Server: Central hub for processing incoming data and managing traffic priorities.
- API Server: Handles GPS data collection and processing from voluntary data submissions.
- Database: Stores traffic and GPS data, along with machine learning models.
- Priority Algorithm: Calculates priority scores and schedules signal changes.
- Machine Learning Model: Predicts vehicle routes and updates models regularly.
- Data Collection: Collects GPS from users to further train Route Prediction AI.
The Voluntary Data Collector is an integral part of UrbanFlow, designed to enhance data collection by allowing users to contribute their GPS data. This app helps gather a diverse set of traffic data points, which are used to improve traffic predictions and system efficiency. Users can easily download the app, register, and start contributing data to the system.
To set up the UrbanFlow project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/hilfing/urbanflow.git cd urbanflow
-
Install Dependencies: Ensure you have Python and pip installed. Then, run:
pip install -r requirements.txt
-
Configure Private Keys: Create a
.env
file in the root directory with your API keys:DATABASE_URL_ASYNC=postgresql+asyncpg://user:password@host/dbname DATABASE_URL=postgresql://user:password@host/dbname API_URL = <Voluntary Data Collector API URL> GOOGLE_MAPS_API_KEY=your_google_maps_apikey SECRET_KEY=secret_key_used_for_hashing ALGORITHM=HS256
-
Set Up the Database (UNDER DEVELOPMENT): Initialize the database using:
alembic upgrade head
-
Run the Server: Start the server with:
python main.py train_and_evaluate --download python main.py runserver
- Mobile App: Install the UrbanFlow app on emergency vehicle drivers' phones to send GPS data.
- Voluntary Data Collector: Encourage users to download and use the Voluntary Data Collector app to submit GPS data voluntarily.
- Web Interface: Access the UrbanFlow web dashboard to monitor traffic and manage configurations.
- Notifications: Receive real-time notifications on traffic signal updates and priority routes.
We welcome contributions to UrbanFlow! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
. - Make your changes and commit them:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature/your-feature-name
. - Submit a pull request.
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
- This project was developed as part of the ISEF project by Indradip Paul.
- Special thanks to my mentor for guidance and support.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or suggestions, feel free to reach out:
- Email: indradip.paul@outlook.com
- GitHub: HilFing