How zeus0390/ppe-detection-for-construction-site-safety works
This is a configurable construction-site PPE monitoring application. Its principal workflow captures camera video, detects people and PPE, evaluates violations, and delivers MQTT reports; the cloud mode additionally consumes Kinesis video, calls a deployed model, and can retain images and violation records. Local and cloud execution are selected at the entry point. The graph includes documented local mode and hardware status functionality, but wiring for unsampled modules is shown only where supported by the README or sampled source.
Main entry points: cloudapp.py Cloud application · localapp.py Local application · detection.py PPE detection · main.py Mode selector
Components 21
Application modes
- Mode selector
main.py - Local application
src/localapp.py - Cloud application
src/cloud/cloudapp.py
Video input
- Camera capture
src/camera.py - Kinesis consumer
src/cloud/kinesis_video_stream_consumer.py - Device indicators
src/indicator.py
Detection and reporting
- PPE detection
src/detection.py - Deployed model
src/cloud/deployedmodel.py - Bounding boxes
src/box.py - MQTT client
src/client.py
Persistence
- Database operations
src/db/crud.py - Database handler
src/db/database.py - Violation schema
src/db/tables.py
Cloud integrations
- Image storage client
src/cloud/s3storage.py
Other components
- Safety officers
- Raspberry Pi camera
- MQTT service
- Relational database
- Amazon S3
- Model endpoint
- Kinesis video service
Connections 25
- Safety officers → Mode selector: selects mode
- Mode selector → Local application: starts local
- Mode selector → Cloud application: starts cloud
- Raspberry Pi camera → Camera capture: provides video
- Local application → Camera capture: uses capture
- Local application → PPE detection: starts detection
- Camera capture → PPE detection: supplies frames
- PPE detection → Bounding boxes: checks overlap
- PPE detection → MQTT client: publishes reports
- MQTT client → MQTT service: publishes MQTT
- MQTT service → Safety officers: delivers reports
- Cloud application → Kinesis consumer: consumes stream
- Kinesis video service → Kinesis consumer: provides stream
- Cloud application → Deployed model: requests inference
- Deployed model → Model endpoint: invokes endpoint
- Cloud application → MQTT client: connects and configures
- Cloud application → Database operations: records violations
- Cloud application → Image storage client: uploads images
- Image storage client → Amazon S3: writes objects
- Database operations → Database handler: uses sessions
- Database handler → Violation schema: creates mappings
- Database handler → Relational database: reads and writes
- Database operations → Relational database: queries records
- Violation schema → Image storage client: deletes linked image
- Local application → Device indicators: uses indicators