How rohithgp05/ai-construction-safety-monitoring-system works
This is a construction-site safety monitoring application. The main workflow is a user submitting an image or video, or enabling webcam capture; the Flask backend runs object detection and spatial safety checks, annotates frames, and records violations and summary metrics. The dashboard presents logs and analytics, while a report endpoint generates CSV/PDF exports. Training is represented as a separate model-development capability. Some dashboard and video-route details are documented but not fully excerpted, so those links cite the README.
Main entry points: app.py Flask API · app.js Analytics Dashboard · inference.py YOLO Inference · database.py Audit Database
Components 17
Dashboard and Capture
- Analytics Dashboard
frontend/js/app.js - Image and Video Upload
frontend/js/app.js - Webcam Capture
frontend/js/app.js
Detection and Safety
- Flask API
backend/app.py - Frame Processing
backend/app.py - Video Processing
backend/app.py - YOLO Inference
backend/inference.py - Safety Rules
backend/safety_logic.py - Annotated Frames
backend/inference.py
Audit and Analytics
- Audit Database
backend/database.py - Statistics Aggregation
backend/database.py - Violation Logs
backend/database.py
Compliance Reports
- Report Download API
backend/app.py - CSV and PDF Reports
reports/generator.py
Model Training
- YOLO Training
models/train.py - Model Weights
models/weights/best.pt
Other components
- Safety Officer
Connections 21
- Safety Officer → Analytics Dashboard: uses
README.md - Analytics Dashboard → Image and Video Upload: submits media
README.md - Analytics Dashboard → Webcam Capture: captures frames
README.md - Image and Video Upload → Flask API: uploads media
README.md - Webcam Capture → Flask API: posts frames
frontend/js/app.js - Flask API → Frame Processing: processes images
backend/app.py - Flask API → Video Processing: starts processing
backend/app.py - Frame Processing → YOLO Inference: runs inference
backend/app.py - Video Processing → YOLO Inference: runs inference
backend/app.py - YOLO Inference → Safety Rules: evaluates detections
backend/inference.py - YOLO Inference → Annotated Frames: draws overlays
backend/inference.py - Frame Processing → Audit Database: logs results
backend/app.py - Video Processing → Audit Database: logs results
backend/app.py - Audit Database → Statistics Aggregation: aggregates metrics
backend/database.py - Analytics Dashboard → Flask API: requests statistics
README.md - Analytics Dashboard → Violation Logs: displays audit logs
README.md - Flask API → Report Download API: routes downloads
backend/app.py - Report Download API → CSV and PDF Reports: generates exports
backend/app.py - CSV and PDF Reports → Audit Database: reads logs and metrics
reports/generator.py - YOLO Training → Model Weights: produces weights
README.md - Model Weights → YOLO Inference: loads model
README.md