# nvidia-ai-iot/deepstream-occupancy-analytics architecture

> Architecture diagram of the GitHub repository nvidia-ai-iot/deepstream-occupancy-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nvidia-ai-iot/deepstream-occupancy-analytics
- Repository: https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics

## Overview

This is a DeepStream occupancy-analytics sample: the application processes streaming video, detects people, counts tripwire crossings, and publishes event data over Kafka. The graph preserves the documented inference, analytics, metadata, and messaging stages. Source excerpts are partial, so some pipeline links rely on README statements rather than inspected call sites; the analytics parser’s metadata transformation is directly shown.

Main entry points: [`deepstream_test5_app_main.c`](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/deepstream_test5_app_main.c) (DeepStream app), [`config/pgie_peoplenet_tao_config.txt`](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/pgie_peoplenet_tao_config.txt) (PeopleNet inference), [`config/nvdsanalytics_config.txt`](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/nvdsanalytics_config.txt) (Tripwire analytics), [`deepstream_nvdsanalytics_meta.cpp`](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/deepstream_nvdsanalytics_meta.cpp) (Analytics parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_app["DeepStream app"]
  node_config["Pipeline config"]
end

subgraph group_vision["Video analytics"]
  node_inference["PeopleNet inference"]
  node_tripwire["Tripwire analytics"]
  node_parser["Analytics parser"]
  node_analytics_meta["Analytics counts<br/>[analytics.h]"]
end

subgraph group_events["Event data"]
  node_event_meta["Event metadata<br/>[nvdsmeta_schema.h]"]
end

subgraph group_messaging["Messaging"]
  node_msg_converter["Message converter"]
  node_kafka["Kafka broker"]
end

node_video(("Video stream"))
node_consumer(("Kafka consumer"))

node_video -->|"streams into"| node_app
node_config -->|"configures"| node_app
node_app -->|"runs detection"| node_inference
node_inference -->|"supplies detections"| node_tripwire
node_tripwire -->|"provides counts"| node_parser
node_parser -->|"fills counts"| node_analytics_meta
node_app -->|"uses event schema"| node_event_meta
node_app -->|"sends analytics"| node_msg_converter
node_msg_converter -->|"publishes messages"| node_kafka
node_consumer -->|"reads messages"| node_kafka

click node_app "https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/deepstream_test5_app_main.c"
click node_config "https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/dstest_occupancy_analytics.txt"
click node_inference "https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/pgie_peoplenet_tao_config.txt"
click node_tripwire "https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/nvdsanalytics_config.txt"
click node_parser "https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/deepstream_nvdsanalytics_meta.cpp"
click node_analytics_meta "https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/includes/analytics.h"
click node_event_meta "https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/includes/nvdsmeta_schema.h"
click node_msg_converter "https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/msgconv_sample_config.txt"

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_app,node_config toneBlue
class node_inference,node_tripwire,node_parser,node_analytics_meta toneAmber
class node_event_meta toneMint
class node_msg_converter,node_kafka toneRose
class node_video,node_consumer toneIndigo
```

## Components

### Application

- [DeepStream app](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/deepstream_test5_app_main.c): `deepstream_test5_app_main.c`
- [Pipeline config](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/dstest_occupancy_analytics.txt): `config/dstest_occupancy_analytics.txt`

### Video analytics

- [PeopleNet inference](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/pgie_peoplenet_tao_config.txt): `config/pgie_peoplenet_tao_config.txt`
- [Tripwire analytics](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/nvdsanalytics_config.txt): `config/nvdsanalytics_config.txt`
- [Analytics parser](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/deepstream_nvdsanalytics_meta.cpp): `deepstream_nvdsanalytics_meta.cpp`
- [Analytics counts](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/includes/analytics.h): `includes/analytics.h`

### Event data

- [Event metadata](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/includes/nvdsmeta_schema.h): `includes/nvdsmeta_schema.h`

### Messaging

- [Message converter](https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics/blob/master/config/msgconv_sample_config.txt): `config/msgconv_sample_config.txt`
- **Kafka broker**

### Other components

- **Video stream**
- **Kafka consumer**

## Connections

- Video stream → DeepStream app: streams into (evidence: `README.md`)
- Pipeline config → DeepStream app: configures (evidence: `README.md`)
- DeepStream app → PeopleNet inference: runs detection (evidence: `README.md`)
- PeopleNet inference → Tripwire analytics: supplies detections (evidence: `README.md`)
- Tripwire analytics → Analytics parser: provides counts (evidence: `README.md`)
- Analytics parser → Analytics counts: fills counts (evidence: `deepstream_nvdsanalytics_meta.cpp`)
- DeepStream app → Event metadata: uses event schema (evidence: `deepstream_test5_app_main.c`)
- DeepStream app → Message converter: sends analytics (evidence: `README.md`)
- Message converter → Kafka broker: publishes messages (evidence: `README.md`)
- Kafka consumer → Kafka broker: reads messages (evidence: `README.md`)
