# oxm-tech/oxm-vision architecture

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

- Interactive diagram: https://gitdiagram.com/oxm-tech/oxm-vision
- Repository: https://github.com/oxm-tech/oxm-vision

## Overview

OXM Vision is a Jetson-based, multi-camera surveillance application. Its runtime captures CSI and USB video plus USB audio; analyzes frames and audio for objects, faces, falls, speech, and keywords; correlates events; persists them; and serves live views, search, and reports through a web dashboard. The main processing and orchestration responsibilities are concentrated in `src/main.py`; supporting modules implement CSI capture, face identity, pose analysis, event storage, and dashboard behavior. README capabilities not visible in the sampled excerpts are included where documented; their internal wiring is not asserted.

Main entry points: [`src/main.py`](https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py) (Event correlation), [`src/dashboard.py`](https://github.com/oxm-tech/oxm-vision/blob/main/src/dashboard.py) (Web dashboard), [`src/face_reid.py`](https://github.com/oxm-tech/oxm-vision/blob/main/src/face_reid.py) (Face re-identification), [`src/csi_worker.py`](https://github.com/oxm-tech/oxm-vision/blob/main/src/csi_worker.py) (CSI capture worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Input capture"]
  node_csi_capture["CSI capture worker<br/>[csi_worker.py]"]
  node_video_capture["Video capture<br/>[main.py]"]
  node_audio_capture["Audio capture<br/>[main.py]"]
end

subgraph group_analysis["Detection and analysis"]
  node_object_detection["Object detection<br/>[main.py]"]
  node_audio_analysis["Audio classification<br/>[main.py]"]
  node_speech_transcription["Speech transcription<br/>[main.py]"]
  node_face_reid["Face re-identification<br/>[face_reid.py]"]
  node_fall_detection["Fall detection<br/>[pose.py]"]
end

subgraph group_events["Events and identity"]
  node_event_correlation["Event correlation<br/>[main.py]"]
  node_event_store[("SQLite event store<br/>[db.py]")]
  node_face_store[("Face embedding store<br/>[face_reid.py]")]
  node_face_enrollment["Face enrollment<br/>[enroll_live.py]"]
end

subgraph group_web["Dashboard and reporting"]
  node_dashboard["Web dashboard<br/>[dashboard.py]"]
  node_daily_report["PDF daily report<br/>[dashboard.py]"]
end

node_operator(("Operator"))
node_csi_camera(("CSI camera"))
node_usb_camera(("USB camera"))
node_usb_audio(("USB audio"))
node_telegram(("Telegram"))
node_llm(("LLM service"))

node_csi_camera -->|"provides frames"| node_csi_capture
node_csi_capture -->|"streams frames"| node_video_capture
node_usb_camera -->|"provides frames"| node_video_capture
node_usb_audio -->|"provides audio"| node_audio_capture
node_video_capture -->|"analyzes frames"| node_object_detection
node_video_capture -->|"queues frames"| node_face_reid
node_video_capture -->|"analyzes poses"| node_fall_detection
node_audio_capture -->|"classifies audio"| node_audio_analysis
node_audio_capture -->|"transcribes speech"| node_speech_transcription
node_object_detection -->|"emits detections"| node_event_correlation
node_face_reid -->|"emits identities"| node_event_correlation
node_fall_detection -.->|"emits fall events"| node_event_correlation
node_audio_analysis -.->|"emits audio events"| node_event_correlation
node_speech_transcription -->|"correlates speech"| node_event_correlation
node_event_correlation -->|"writes events"| node_event_store
node_face_reid -->|"loads and saves"| node_face_store
node_face_enrollment -->|"updates embeddings"| node_face_store
node_operator -->|"enrolls person"| node_face_enrollment
node_operator -->|"views surveillance"| node_dashboard
node_dashboard -->|"queries events"| node_event_store
node_dashboard -->|"requests report"| node_daily_report
node_daily_report -->|"sends report"| node_telegram
node_dashboard -.->|"queries chat"| node_llm
node_event_correlation -.->|"sends alerts"| node_telegram

click node_csi_capture "https://github.com/oxm-tech/oxm-vision/blob/main/src/csi_worker.py"
click node_video_capture "https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py"
click node_audio_capture "https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py"
click node_object_detection "https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py"
click node_audio_analysis "https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py"
click node_speech_transcription "https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py"
click node_face_reid "https://github.com/oxm-tech/oxm-vision/blob/main/src/face_reid.py"
click node_fall_detection "https://github.com/oxm-tech/oxm-vision/blob/main/src/pose.py"
click node_event_correlation "https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py"
click node_event_store "https://github.com/oxm-tech/oxm-vision/blob/main/src/db.py"
click node_face_store "https://github.com/oxm-tech/oxm-vision/blob/main/src/face_reid.py"
click node_face_enrollment "https://github.com/oxm-tech/oxm-vision/blob/main/src/enroll_live.py"
click node_dashboard "https://github.com/oxm-tech/oxm-vision/blob/main/src/dashboard.py"
click node_daily_report "https://github.com/oxm-tech/oxm-vision/blob/main/src/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_csi_capture,node_video_capture,node_audio_capture toneBlue
class node_object_detection,node_audio_analysis,node_speech_transcription,node_face_reid,node_fall_detection toneAmber
class node_event_correlation,node_event_store,node_face_store,node_face_enrollment toneMint
class node_dashboard,node_daily_report toneRose
class node_operator,node_csi_camera,node_usb_camera,node_usb_audio,node_telegram,node_llm toneIndigo
```

## Components

### Input capture

- [CSI capture worker](https://github.com/oxm-tech/oxm-vision/blob/main/src/csi_worker.py): `src/csi_worker.py`
- [Video capture](https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py): `src/main.py`
- [Audio capture](https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py): `src/main.py`

### Detection and analysis

- [Object detection](https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py): `src/main.py`
- [Audio classification](https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py): `src/main.py`
- [Speech transcription](https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py): `src/main.py`
- [Face re-identification](https://github.com/oxm-tech/oxm-vision/blob/main/src/face_reid.py): `src/face_reid.py`
- [Fall detection](https://github.com/oxm-tech/oxm-vision/blob/main/src/pose.py): `src/pose.py`

### Events and identity

- [Event correlation](https://github.com/oxm-tech/oxm-vision/blob/main/src/main.py): `src/main.py`
- [SQLite event store](https://github.com/oxm-tech/oxm-vision/blob/main/src/db.py): `src/db.py`
- [Face embedding store](https://github.com/oxm-tech/oxm-vision/blob/main/src/face_reid.py): `src/face_reid.py`
- [Face enrollment](https://github.com/oxm-tech/oxm-vision/blob/main/src/enroll_live.py): `src/enroll_live.py`

### Dashboard and reporting

- [Web dashboard](https://github.com/oxm-tech/oxm-vision/blob/main/src/dashboard.py): `src/dashboard.py`
- [PDF daily report](https://github.com/oxm-tech/oxm-vision/blob/main/src/dashboard.py): `src/dashboard.py`

### Other components

- **Operator**
- **CSI camera**
- **USB camera**
- **USB audio**
- **Telegram**
- **LLM service**

## Connections

- CSI camera → CSI capture worker: provides frames (evidence: `README.md`)
- CSI capture worker → Video capture: streams frames (evidence: `src/main.py`)
- USB camera → Video capture: provides frames (evidence: `src/main.py`)
- USB audio → Audio capture: provides audio (evidence: `README.md`)
- Video capture → Object detection: analyzes frames (evidence: `src/main.py`)
- Video capture → Face re-identification: queues frames (evidence: `src/main.py`)
- Video capture → Fall detection: analyzes poses (evidence: `README.md`)
- Audio capture → Audio classification: classifies audio (evidence: `src/main.py`)
- Audio capture → Speech transcription: transcribes speech (evidence: `README.md`)
- Object detection → Event correlation: emits detections (evidence: `src/main.py`)
- Face re-identification → Event correlation: emits identities (evidence: `src/main.py`)
- Fall detection → Event correlation: emits fall events (evidence: `src/main.py`)
- Audio classification → Event correlation: emits audio events (evidence: `src/main.py`)
- Speech transcription → Event correlation: correlates speech (evidence: `src/main.py`)
- Event correlation → SQLite event store: writes events (evidence: `src/main.py`)
- Face re-identification → Face embedding store: loads and saves (evidence: `src/face_reid.py`)
- Face enrollment → Face embedding store: updates embeddings (evidence: `src/enroll_live.py`)
- Operator → Face enrollment: enrolls person (evidence: `README.md`)
- Operator → Web dashboard: views surveillance (evidence: `README.md`)
- Web dashboard → SQLite event store: queries events (evidence: `src/dashboard.py`)
- Web dashboard → PDF daily report: requests report (evidence: `README.md`)
- PDF daily report → Telegram: sends report (evidence: `README.md`)
- Web dashboard → LLM service: queries chat (evidence: `README.md`)
- Event correlation → Telegram: sends alerts (evidence: `README.md`)
