Women Safety SOS https://github.com/RAVI-RAJPUT-UMATH/Women_Safety : A quick emergency response system for women's safety.
Signal Automation https://github.com/pawankushwahh/Signal_Automation : An AI-driven system for optimizing traffic signals based on real-time traffic density.
Traffic Rule Violation Detection and Notification System** (This repository): Automated detection of traffic rule violations using computer vision.
Video Demonstration https://drive.google.com/file/d/1GaEdtEzO_qE81oPrjO9-C9Vlkk_zl1CV/view?usp=sharing
An automated system that detects traffic rule violations using computer vision, processes the violations, and sends notifications to both violators and traffic authorities.
- Real-time Violation Detection: Uses YOLOv8 for detecting vehicles and identifying violations
- Multiple Violation Types: Detects various violations including:
- No Helmet
- Wrong Side Driving
- Signal Jump
- Automated Notifications: Sends instant notifications to:
- Vehicle owners (SMS)
- Traffic authorities (SMS + Email)
- Violation Logging: Maintains detailed logs of all violations
- Fine Generation: Automatically calculates fines based on violation type
- Python 3.8 or higher
- Twilio account for SMS notifications
- CSV files with required data:
vehicle_database.csv: Vehicle owner informationlocation_authorities.csv: Traffic authority contact detailsviolation_log.csv: Log of detected violations
-
Clone the repository:
git clone https://github.com/pawankushwahh/traffic-violation-detection.git cd traffic-violation-detection -
Install required packages:
pip install -r requirements.txt
-
Set up environment variables in
.envfile:TWILIO_ACCOUNT_SID=your_account_sid TWILIO_AUTH_TOKEN=your_auth_token TWILIO_PHONE_NUMBER=your_twilio_phone
rule_1/
├── data/
│ ├── vehicle_database.csv # Vehicle owner information
│ └── location_authorities.csv # Authority contact details
├── violations/
│ └── violation_log.csv # Violation records
├── notification_logs/ # Notification history
├── violation_detector.py # Main detection script
├── notification_system.py # Notification handling
└── requirements.txt # Project dependencies
-
Start the Violation Detection System:
python violation_detector.py
-
Process Violations and Send Notifications:
python notification_system.py
To test without sending actual notifications:
python notification_system.py --simulation
-
vehicle_database.csv:
Vehicle_Number,Owner_Name,Phone_Number,Address UP32UV1111,Aditya Mishra,+91XXXXXXXXXX,45 Indira Nagar -
violation_log.csv:
Vehicle_Number,Violation_Type,Location,Violation_Time,Fine_Amount UP32UV1111,No Helmet,Hazratganj,2025-02-15 08:20:00,500
-
Violator Notification:
Traffic Violation Notice Dear [Owner Name], Your vehicle ([Vehicle Number]) was detected violating traffic rules: Violation: [Violation Type] Location: [Location] Time: [Timestamp] Fine Amount: Rs. [Amount] -
Authority Notification:
New Traffic Violation Detected Vehicle Number: [Number] Violation Type: [Type] Location: [Location] Time: [Timestamp] Vehicle Owner: [Name] Owner Contact: [Phone] Fine Amount: Rs. [Amount]
-
No Notifications Being Sent:
- Check if Twilio credentials are correctly set in
.env - Verify vehicle exists in database
- Check network connectivity
- Check if Twilio credentials are correctly set in
-
Vehicle Not Found:
- Ensure vehicle information is present in
vehicle_database.csv - Check if vehicle number format matches database format
- Ensure vehicle information is present in
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
mail - Kushwahpawan2005@gmail.com Project Link: https://github.com/pawankushwahh/traffic-violation-detection