YOLOv8 model trained on a custom accident/fire/smoke dataset. Live MJPEG streaming, instant WebSocket alerts with snapshot evidence, and a MongoDB alert log.
View Source on GitHub Run it yourselfAccident ยท Fire ยท Smoke โ custom YOLOv8 model (best.pt, 22 MB) trained on the 30_SCFD dataset.
Annotated frames served as an MJPEG feed (/video_feed) โ watch detections as they happen.
flask-socketio pushes alert cards with base64 snapshot + timestamp. Throttled per-class so one incident doesn't flood the DB.
Signup/signin with hashed passwords, protected dashboard & alert history pages.
MongoDB stores every alert (type, image, timestamp); history API returns the latest 100.
Video file, webcam index, or RTSP camera URL โ set VIDEO_SOURCE and go.
CCTV / video file โโโบ YOLOv8 (custom weights)
โ
โผ frame inference + annotation
Flask + flask-socketio โโโโโบ browser (MJPEG stream + alert toasts)
โ
โผ
MongoDB (alerts collection)
Python 3.10Flaskflask-socketioYOLOv8 / UltralyticsOpenCVMongoDBeventlet
git clone https://github.com/alokscfd9004/crash-fire-detection
cd crash-fire-detection/Final-Year-Project/final_project/Code
pip install -r requirements.txt
cp .env.example .env # set SECRET_KEY + MONGO_URI
python app.py # โ http://localhost:5500
๐ Full methodology + results are in the project report and published paper (IJSREM) bundled in the repository.
Built by Alok Kumar & team ยท portfolio: my-portfolio-alok.vercel.app