STSMS is an AI-powered system designed to enhance street safety , ambulance prioritization and traffic control using computer vision and machine learning. It integrates real-time surveillance and automated decision-making for improved urban management.
- AI-powered accident , threat , face recongnition and women safety management system.
- Detects ambulances at intersections.
- Adjusts traffic signals dynamically to prioritize emergency vehicles to save lives.
- Analyzes vehicle density using AI-driven traffic monitoring.
- Optimizes signal timing to reduce congestion and improve traffic flow.
- Computer Vision & AI: OpenCV, Deep Learning Models.
- Incident Detection: LLM with Flask API.
- Traffic & Ambulance Detection: YOLO-based object detection.
- Backend: Flask API for real-time processing.
- Database: PostgreSQL / MySQL for incident and vehicle data storage.
The Street Safety Management System is an AI-powered solution designed to enhance urban safety by monitoring streets through cameras, recognizing faces using *OpenCV, and detecting incidents using *a Large Language Model (LLM) with Flask. It integrates real-time surveillance, face matching, and an automated alert system to notify law enforcement and the public about emergencies.
- Face Recognition: OpenCV and Deep Learning Models (Python-based real-time detection and matching)
- Incident Detection: LLM integrated with Flask (AI-based classification of incidents)
- Backend: Flask for API development
- Database: MySQL for storing wanted persons and incident reports
- Camera Capture: Captures live footage from street cameras.
- Captured Frame: Stores individual frames extracted from video footage.
- Frame Storage: Saves frames for further analysis by the system.
- Face Detection: Uses OpenCV to detect human faces in captured frames.
- Feature Extraction: Extracts facial features using OpenCV's deep learning models.
- Face Matching: Compares detected faces with a database of wanted persons.
- Wanted Person DB: Contains records of individuals flagged as wanted.
- Police Alert System: Triggers alerts to law enforcement if a match is found.
- Image Preprocessing: Enhances image quality for better analysis.
- Incident Classification Model: Uses an LLM to classify incidents (e.g., fights, accidents, theft, women harassment).
- Flask API Integration: A REST API built with Flask connects the LLM to the system for real-time processing.
- Incident Type: Determines the nature of the detected incident.
- User Alert System: Notifies Emergency Services based on the incident type.
- Emergency Alert Successful: Confirms that the alert has been successfully sent to authorities.
- Camera Module captures real-time footage and extracts frames.
- Frames are analyzed using OpenCV-based Face Recognition to identify known suspects.
- The same frames are processed by the LLM-powered Incident Detection Module via Flask API to classify events.
- If a wanted suspect is found or an incident is detected, the Police Alert System is triggered.
- Alerts are sent to the *Control Center, nearby law enforcement via the *Alert & Response System.
git clone https://github.com/apoorv1110/STSMS.git
cd Street-Safety-Management-System
python3 llm_service.py
python3 judging_service/run_judge.py
python3 LLM.py
python3 capture_service/run_capture.py
- The camera captures images in real time.
- The images are matched against the wanted database.
- The LLM service processes the image for incident detection.
- The system returns results from both modules and triggers alerts if necessary.
β Real-time Face Recognition with OpenCV β Identifies wanted persons instantly.
β AI-powered Incident Detection with LLM + Flask β Classifies incidents in real-time.
β Automated Police Alerts β Notifies law enforcement of emergencies.
β REST API Integration β Ensures smooth communication between different modules.
- Expanded Missing Persons Database β To assist in rescue operations.
The Ambulance Management Module ensures emergency vehicle prioritization at intersections using AI-based detection and real-time traffic signal control.
- Ambulance Detection: YOLO-based object detection.
- Traffic Signal Control: AI-driven dynamic light adjustment.
- Communication Module: Flask API for signal updates.
- Captures live traffic footage.
- Uses AI to detect ambulances in real time.
- Adjusts signals dynamically to allow ambulance passage.
- Holds non-emergency vehicles for 10 seconds.
- Notifies upcoming intersections to clear the path.
- Updates traffic status via a centralized server.
- Uses Flask API for real-time signal adjustments.
- Camera Module detects ambulances in real-time using YOLO.
- Traffic Signal Control System adjusts lights accordingly.
- Nearby intersections receive alerts to prepare for the ambulance.
- Non-emergency vehicles are held for 10 seconds.
cd Ambulance_management-System
python3 ambulance_detector.py
β Real-time Ambulance Detection β Instantly identifies ambulances.
β Automated Signal Adjustment β Prioritizes emergency vehicles.
β Path Clearance System β Holds non-emergency vehicles temporarily.
β API-based Integration β Ensures smooth system communication.
The Traffic Signal Control Module dynamically adjusts traffic lights based on real-time vehicle density and emergency vehicle detection. It optimizes traffic flow, reduces congestion, and ensures smooth passage for ambulances.
- Traffic Density Analysis: AI-based monitoring using OpenCV and YOLO.
- Signal Timing Optimization: Dynamic adjustments using ML models.
- Emergency Vehicle Priority: Integrated with Ambulance Management System.
- Backend: Flask API for real-time updates.
- Database: PostgreSQL / MySQL for traffic data storage.
- Analyzes real-time traffic density.
- Detects emergency vehicles and adjusts signals accordingly.
- Adjusts light durations based on congestion levels.
- Extends green signals for ambulances.
- Reduces wait times at busy intersections.
- Camera Module captures real-time traffic footage.
- AI-powered Signal Optimization analyzes traffic density and emergency vehicle presence.
- Signal Timing Adjustment dynamically modifies traffic light durations.
- Emergency Priority Activation extends green signals for ambulances.
- Live Updates Sent to other intersections to ensure smooth traffic flow.
cd Traffic Management System
python3 main.py
β AI-powered Traffic Monitoring β Real-time congestion analysis.
β Dynamic Signal Adjustment β Reduces congestion and improves flow.
β Emergency Vehicle Priority β Ensures smooth passage for ambulances