How avishkar-chavan1/ai-camera-detection works
Industrial Safety AI is a PPE detection and compliance platform: a user uploads an image or video in the Streamlit dashboard, which sends media bytes to the FastAPI service; inference produces detections and worker compliance results, which the dashboard displays. The dashboard also supports a host-local webcam workflow. A separate local vision runtime handles camera/video tracking and PPE association. README documents health, readiness, metrics, event history, and upload validation; sampled source shows the main API and local-pipeline wiring. Unsampled route details are not expanded beyond documented capabilities.
Main entry points: pipeline.py Video pipeline · main.py API application · app.py Streamlit dashboard · inference.py YOLO inference
Components 20
User experience
- Streamlit dashboard
dashboard/app.py
Inference API
- API routes
backend/app/api/routes.py - API application
backend/app/main.py - Response adapter
backend/app/services/inference_service.py
Vision processing
- YOLO inference
vision/inference.py - Compliance rules
vision/compliance.py - Vision data types
vision/models.py - Local vision CLI
vision/cli.py - Video pipeline
vision/pipeline.py - Camera/video input
vision/video_input.py - Person tracking
vision/tracking.py - PPE detection
vision/detection.py - Worker PPE association
vision/association.py - Frame annotation
vision/visualization.py
Configuration and records
- Settings
backend/app/core/config.py - Application logging
backend/app/core/logging.py - Inference event log
vision/event_log.py - PPE checkpoint
best.pt
Other components
- Operator
- Ultralytics runtime
Connections 25
- Operator → Streamlit dashboard: submits media
README.md - Streamlit dashboard → API routes: sends media bytes
dashboard/app.py - API routes → Response adapter: requests inference
backend/app/api/routes.py - Response adapter → YOLO inference: runs inference
backend/app/services/inference_service.py - Response adapter → Compliance rules: analyzes compliance
backend/app/services/inference_service.py - API application → API routes: registers routes
backend/app/main.py - API application → Settings: loads settings
backend/app/main.py - API application → YOLO inference: loads model
backend/app/main.py - API application → Inference event log: initializes logger
backend/app/main.py - API application → Application logging: configures logging
backend/app/main.py - API application → PPE checkpoint: loads checkpoint
backend/app/main.py - YOLO inference → Ultralytics runtime: loads YOLO
vision/inference.py - YOLO inference → Vision data types: creates detections
vision/inference.py - Compliance rules → Vision data types: uses bounding boxes
vision/compliance.py - Local vision CLI → Video pipeline: starts pipeline
vision/cli.py - Video pipeline → Camera/video input: reads frames
vision/pipeline.py - Video pipeline → Person tracking: tracks workers
vision/pipeline.py - Video pipeline → PPE detection: detects PPE
vision/pipeline.py - Video pipeline → Worker PPE association: associates detections
vision/pipeline.py - Video pipeline → Frame annotation: annotates frames
vision/pipeline.py - Video pipeline → Settings: builds from settings
vision/pipeline.py - Streamlit dashboard → YOLO inference: runs local inference
README.md - Streamlit dashboard → Compliance rules: shows compliance
README.md - Streamlit dashboard → Inference event log: records local events
dashboard/app.py - API routes → Inference event log: reads event history
backend/app/api/routes.py