Aegis Eye is a full-stack, production-grade Computer Vision and Deep Learning solution designed to monitor traffic streams in real time. It detects vehicle collisions, identifies helmet violations, calculates confidence scores, and alerts responders through an interactive React dashboard with WebSocket streaming.
- ⚡ Real-Time Collision & Helmet Detection: Dual pipeline leveraging YOLOv8 for spatial object detection & ResNet18 + Attentive LSTM for temporal sequence analysis.
- 🔄 Live WebSocket Video Streaming: Frame-by-frame processing with bounding box overlays streamed directly to the dashboard over WebSockets.
- 🗺️ DIGIPIN & Geospatial Mapping: Automatic coordinate mapping and DIGIPIN spatial indexing for rapid emergency dispatch location tracking.
- 📊 Telemetry & Analytics Dashboard: Sleek React UI with real-time graphs, incident history logs, snapshot capture, and alert notifications.
- 📁 Multi-Source Video Processing: Support for live webcam streams, uploaded video files (
.mp4,.avi), RTSP streams, and pre-loaded sample datasets.
graph TD
A[Camera Stream / MP4 / RTSP] -->|Frame Ingestion| B[Python Worker Service]
B -->|Object Bounding Boxes| C[YOLOv8 Detection Engine]
B -->|Temporal Feature Aggregation| D[ResNet18 + LSTM Model]
C --> E[Inference Engine & Telemetry Compiler]
D --> E
E -->|JSON + Base64 Frames| F[Node.js Express + WS Gateway]
F -->|WebSocket Push| G[React + Vite Frontend Dashboard]
E -->|Incident Logging & Snapshots| H[(SQLite Database)]
| Layer | Technologies & Tools |
|---|---|
| Frontend | React 18, Vite, Lucide Icons, Custom Design Tokens |
| Backend Gateway | Node.js, Express.js, WebSockets (ws), Multer |
| AI / Machine Learning | Python 3.9+, PyTorch, Ultralytics YOLOv8, OpenCV, Scikit-Learn |
| Database & Utilities | SQLite3, Pandas, NumPy, DIGIPIN Helper Utilities |
Ensure you have the following installed:
- Node.js:
v18.0.0or higher - Python:
v3.9tov3.11 - Git: Latest version
git clone https://github.com/your-username/accident_detection_System.git
cd accident_detection_Systemcd accident_detection
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Linux / macOS:
source venv/bin/activate
# Install Python requirements
pip install -r requirements.txtOpen a new terminal window:
cd accident_detection/backend
npm install(Optional) Copy .env.example to .env:
cp .env.example .envOpen a third terminal window:
cd accident_detection/frontend
npm installIn the accident_detection/backend directory:
npm run devServer runs at
http://localhost:8000(WebSocket endpoint atws://localhost:8000/ws).
In the accident_detection/frontend directory:
npm run devOpen your browser at
http://localhost:5173.
accident_detection_System/
├── accident_detection/
│ ├── backend/ # Express + WS Backend Server
│ │ ├── database/ # SQLite schema & loggers
│ │ ├── services/ # Streaming workers & detection services
│ │ ├── utils/ # Config & DIGIPIN location helpers
│ │ ├── server.js # Main Express server entry point
│ │ └── package.json
│ ├── frontend/ # React 18 + Vite Web Dashboard
│ │ ├── src/ # React components & UI state
│ │ ├── vite.config.js
│ │ └── package.json
│ ├── models/ # Pre-trained YOLOv8 & LSTM weights
│ ├── logs/ # Output snapshots & incident logs
│ ├── requirements.txt # Python ML dependencies
│ └── README.md
├── data/ # Sample benchmark videos
├── LICENSE # MIT Open Source License
└── README.md # Main Repository Documentation
This project is licensed under the MIT License.