# nagurukethankumarreddy-alt/craftifaihackathon_cra004 architecture

> Architecture diagram of the GitHub repository nagurukethankumarreddy-alt/craftifaihackathon_cra004, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004
- Repository: https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004

## Overview

AegisVision is an industrial worker-safety sentinel: shop-floor video is analyzed for tracked workers, hazard-zone intrusion, and sustained falls; the pipeline applies privacy redaction and emits metadata and alerts for supervisors and machinery response. The README documents this pipeline, its model optimization, and a Streamlit command-center dashboard. The dashboard excerpt shows scenario-based sample incidents and performance displays, not MQTT subscription code; the runtime pipeline’s implementation is represented by documented configuration and run-script paths, whose contents were not sampled.

Main entry points: [`pipegen_export/deepstream_app_config.txt`](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt) (Privacy and HUD), [`aegis_dashboard.py`](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/aegis_dashboard.py) (Safety command center), [`evidence/pipegen_ir_and_trt_report.txt`](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/evidence/pipegen_ir_and_trt_report.txt) (TensorRT optimization), [`pipegen_export/run.sh`](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/run.sh) (Pipeline runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge_pipeline["Edge perception pipeline"]
  node_pipeline_runner["Pipeline runner<br/>[run.sh]"]
  node_video_decode["Decode and mux"]
  node_person_detection["Person detection"]
  node_worker_tracking["Worker tracking"]
  node_pose_estimation["Pose estimation"]
  node_hazard_rules["Hazard and fall rules"]
  node_privacy_osd["Privacy and HUD"]
end

subgraph group_model_ops["Model optimization"]
  node_model_optimization["TensorRT optimization"]
end

subgraph group_alert_outputs["Safety outputs"]
  node_metadata["JSON metadata"]
  node_mqtt_alert["MQTT safety alert"]
end

subgraph group_command_center["Command center"]
  node_dashboard["Safety command center<br/>[aegis_dashboard.py]"]
  node_performance_view["Performance report<br/>[aegis_dashboard.py]"]
end

node_supervisor(("EHS Supervisor"))
node_video(("Shop-floor video"))
node_mqtt_broker(("MQTT broker"))
node_machinery(("Machinery relay"))

node_pipeline_runner -->|"runs pipeline"| node_video_decode
node_video -->|"provides frames"| node_video_decode
node_video_decode -->|"batches frames"| node_person_detection
node_person_detection -->|"passes detections"| node_worker_tracking
node_worker_tracking -->|"passes tracked boxes"| node_pose_estimation
node_pose_estimation -->|"provides keypoints"| node_hazard_rules
node_hazard_rules -->|"provides events"| node_privacy_osd
node_model_optimization -->|"supplies INT8 model"| node_person_detection
node_model_optimization -->|"supplies INT8 model"| node_pose_estimation
node_privacy_osd -->|"publishes JSON"| node_metadata
node_privacy_osd -->|"publishes alerts"| node_mqtt_alert
node_mqtt_alert -->|"sends MQTT"| node_mqtt_broker
node_mqtt_broker -->|"streams incidents"| node_dashboard
node_mqtt_alert -->|"dispatches relay trip"| node_machinery
node_supervisor -->|"reviews incidents"| node_dashboard
node_dashboard -->|"displays metrics"| node_performance_view

click node_pipeline_runner "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/run.sh"
click node_video_decode "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt"
click node_person_detection "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt"
click node_worker_tracking "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt"
click node_pose_estimation "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt"
click node_hazard_rules "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt"
click node_privacy_osd "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt"
click node_model_optimization "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/evidence/pipegen_ir_and_trt_report.txt"
click node_mqtt_alert "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt"
click node_dashboard "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/aegis_dashboard.py"
click node_performance_view "https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/aegis_dashboard.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pipeline_runner,node_video_decode,node_person_detection,node_worker_tracking,node_pose_estimation,node_hazard_rules,node_privacy_osd toneBlue
class node_model_optimization toneAmber
class node_metadata,node_mqtt_alert toneMint
class node_dashboard,node_performance_view toneRose
class node_supervisor,node_video,node_mqtt_broker,node_machinery toneIndigo
```

## Components

### Edge perception pipeline

- [Pipeline runner](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/run.sh): `pipegen_export/run.sh`
- [Decode and mux](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt): `pipegen_export/deepstream_app_config.txt`
- [Person detection](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt): `pipegen_export/deepstream_app_config.txt`
- [Worker tracking](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt): `pipegen_export/deepstream_app_config.txt`
- [Pose estimation](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt): `pipegen_export/deepstream_app_config.txt`
- [Hazard and fall rules](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt): `pipegen_export/deepstream_app_config.txt`
- [Privacy and HUD](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt): `pipegen_export/deepstream_app_config.txt`

### Model optimization

- [TensorRT optimization](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/evidence/pipegen_ir_and_trt_report.txt): `evidence/pipegen_ir_and_trt_report.txt`

### Safety outputs

- **JSON metadata**
- [MQTT safety alert](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/pipegen_export/deepstream_app_config.txt): `pipegen_export/deepstream_app_config.txt`

### Command center

- [Safety command center](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/aegis_dashboard.py): `aegis_dashboard.py`
- [Performance report](https://github.com/nagurukethankumarreddy-alt/craftifaihackathon_cra004/blob/main/aegis_dashboard.py): `aegis_dashboard.py`

### Other components

- **EHS Supervisor**
- **Shop-floor video**
- **MQTT broker**
- **Machinery relay**

## Connections

- Pipeline runner → Decode and mux: runs pipeline (evidence: `README.md`)
- Shop-floor video → Decode and mux: provides frames (evidence: `README.md`)
- Decode and mux → Person detection: batches frames (evidence: `README.md`)
- Person detection → Worker tracking: passes detections (evidence: `README.md`)
- Worker tracking → Pose estimation: passes tracked boxes (evidence: `README.md`)
- Pose estimation → Hazard and fall rules: provides keypoints (evidence: `README.md`)
- Hazard and fall rules → Privacy and HUD: provides events (evidence: `README.md`)
- TensorRT optimization → Person detection: supplies INT8 model (evidence: `README.md`)
- TensorRT optimization → Pose estimation: supplies INT8 model (evidence: `README.md`)
- Privacy and HUD → JSON metadata: publishes JSON (evidence: `README.md`)
- Privacy and HUD → MQTT safety alert: publishes alerts (evidence: `README.md`)
- MQTT safety alert → MQTT broker: sends MQTT (evidence: `README.md`)
- MQTT broker → Safety command center: streams incidents (evidence: `README.md`)
- MQTT safety alert → Machinery relay: dispatches relay trip (evidence: `README.md`)
- EHS Supervisor → Safety command center: reviews incidents (evidence: `README.md`)
- Safety command center → Performance report: displays metrics (evidence: `aegis_dashboard.py`)
