This project is an AI-powered system for detecting road accidents in real-time and classifying their severity using the YOLOv8 deep learning model. It also integrates risk scoring, insurance policy recommendations, and alert mechanisms (email/SMS), all within a secure web application built using Flask and MongoDB.
Technology | Purpose |
---|---|
YOLOv8 | Real-time object detection |
Flask | Backend framework |
HTML/CSS | Frontend interface |
Bootstrap | Responsive web design |
MongoDB | NoSQL database for user/detection data |
OpenCV | Image and video processing |
SMTP/Twilio | Sending email/SMS alerts |
2.Create a virtual environment (recommended) python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
3.Install dependencies pip install -r requirements.txt
4.Configure MongoDB & Environment Variables
Ensure MongoDB is running locally or use MongoDB Atlas.
Set up .env for sensitive data (API keys, DB URI, email credentials).
5.Train or Load YOLOv8 Model
Download or train a YOLOv8 model on your custom dataset.
Place best.pt in the model/ directory.
โถ๏ธ Running the Application python app.py Then open your browser and go to: http://127.0.0.1:5000/
๐ Project Structure accident-detection/ โ โโโ static/ โ โโโ uploads/, css/ โโโ templates/ โ โโโ *.html โโโ model/ โ โโโ best.pt โโโ app.py โโโ Main.py โโโ requirements.txt โโโ README.md
๐งช Sample Use-Cases ๐จ Detect accidents from uploaded images or live webcam
๐ค Alert admin and users during severe accidents
๐งพ View detection history and personal risk level
๐ Admin assigns insurance policies based on risk
โ Future Enhancements ๐ GPS-based geolocation tracking
๐ฑ Android/iOS mobile app
๐ฅ Multi-camera integration
๐ Integration with police/emergency services API
๐ฉโ๐ป Author JerishRaj โ GitHub Feel free to contribute, raise issues, or suggest improvements!