How druv08/safevision-ai works
SafeVision AI monitors workplace PPE: an operator submits an image or video, the backend runs YOLO detection, records violation evidence, and exposes results for dashboard review. The graph also preserves the documented model-training and dataset-preparation branch. The README describes webcam monitoring and database storage, but the shown runtime endpoints accept image/video uploads and the sampled persistence code writes CSV and screenshots; no webcam API or database integration is evidenced here.
Main entry points: App.jsx SafeVision UI · video_detection_service.py Video detection · api.js API client · detection.py Detection routes
Components 19
Operator interface
- SafeVision UI
frontend/src/App.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Image review
frontend/src/pages/ImageDetection.jsx - Video review
frontend/src/pages/VideoDetection.jsx - Violation review
frontend/src/pages/Violations.jsx - API client
frontend/src/services/api.js
Detection backend
- FastAPI app
backend/main.py - Detection routes
backend/routes/detection.py - Image detection
backend/services/detection_service.py - Video detection
backend/services/video_detection_service.py - YOLO model loader
backend/services/model_service.py
Violation evidence
- Violation reader
backend/services/violations_service.py - Screenshot files
- Violation log
Model development
- Pose auto-labeling
ai-model/training/autolabel_webcam_pose.py - Dataset preparation
ai-model/training - YOLO training
ai-model/training - Trained weights
Other components
- Safety officer
Connections 25
- Safety officer → SafeVision UI: uses
README.md - SafeVision UI → Dashboard: routes to
frontend/src/App.jsx - SafeVision UI → Image review: routes to
frontend/src/App.jsx - SafeVision UI → Video review: routes to
frontend/src/App.jsx - SafeVision UI → Violation review: routes to
frontend/src/App.jsx - Dashboard → API client: requests data
frontend/src/pages/Dashboard.jsx - Image review → API client: submits image
frontend/src/pages/ImageDetection.jsx - Video review → API client: submits video
frontend/src/pages/VideoDetection.jsx - Violation review → API client: requests records
frontend/src/pages/Violations.jsx - API client → FastAPI app: calls API
- FastAPI app → Detection routes: registers routes
backend/main.py - Detection routes → Image detection: invokes
backend/routes/detection.py - Detection routes → Video detection: invokes
backend/routes/detection.py - Detection routes → Violation reader: reads records
backend/routes/detection.py - Image detection → YOLO model loader: loads models
backend/services/detection_service.py - Video detection → YOLO model loader: loads models
backend/services/video_detection_service.py - Image detection → Video detection: saves evidence
backend/services/detection_service.py - Video detection → Screenshot files: writes images
backend/services/video_detection_service.py - Video detection → Violation log: appends records
backend/services/video_detection_service.py - Violation reader → Violation log: reads log
backend/services/violations_service.py - FastAPI app → Screenshot files: serves files
backend/main.py - Pose auto-labeling → Dataset preparation: builds samples
ai-model/training/autolabel_webcam_pose.py - Dataset preparation → YOLO training: prepares data for
- YOLO training → Trained weights: produces weights
- YOLO model loader → Trained weights: loads weights
backend/services/model_service.py