# vinuah-dev/sih-tech-garuda architecture

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

- Interactive diagram: https://gitdiagram.com/vinuah-dev/sih-tech-garuda
- Repository: https://github.com/vinuah-dev/sih-tech-garuda

## Overview

SENTINEL-X is a multi-camera border-surveillance analytics system. Its documented path is camera video through detection, tracking, zone/context analysis, behavior and risk scoring, then alerting and evidence; operators use a live dashboard or JSON API. The graph also preserves documented face recognition, cross-camera following, ANPR/registry checks, camera mapping, and persistence. Edges reflect excerpted calls, SOURCE INDEX references, or README statements; unsampled subsystem links are omitted where ownership is not established.

Main entry points: [`app/pipeline.py`](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/pipeline.py) (Surveillance pipeline), [`app/context/engine.py`](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/context/engine.py) (Movement context), [`app/server/api.py`](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/server/api.py) (JSON API), [`app/runner.py`](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/runner.py) (Multi-camera runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Video &amp; Detection"]
  node_sources["Video sources<br/>[sources.py]"]
  node_network["Network streaming<br/>[stream.py]"]
  node_detector["Object detection<br/>[yolo.py]"]
  node_tracking["Stable tracking<br/>[tracker.py]"]
  node_classes["Object classes<br/>[classes.py]"]
end

subgraph group_analysis["Threat Analysis"]
  node_zones["Virtual fences<br/>[manager.py]"]
  node_geometry["Zone geometry<br/>[geometry.py]"]
  node_context["Movement context<br/>[engine.py]"]
  node_history["Track history<br/>[history.py]"]
  node_calibration["Camera calibration<br/>[calibration.py]"]
  node_behaviour["Behavior analysis<br/>[engine.py]"]
  node_risk["Risk scoring<br/>[engine.py]"]
end

subgraph group_identity["Identity &amp; Vehicles"]
  node_faces["Face recognition<br/>[engine.py]"]
  node_roster[("Guard roster<br/>[roster.py]")]
  node_people["Person following<br/>[people.py]"]
  node_anpr["Plate recognition<br/>[engine.py]"]
  node_ledger[("Plate ledger<br/>[ledger.py]")]
  node_registry[("Vehicle registry<br/>[vehicles.py]")]
end

subgraph group_response["Alerts &amp; Evidence"]
  node_pipeline["Surveillance pipeline<br/>[pipeline.py]"]
  node_events["Alert confirmation<br/>[events.py]"]
  node_clips["Evidence clips<br/>[clips.py]"]
  node_store[("Event database<br/>[database.py]")]
end

subgraph group_operations["Fleet &amp; Interface"]
  node_runner["Multi-camera runner<br/>[runner.py]"]
  node_api["JSON API<br/>[api.py]"]
  node_dashboard["Live dashboard<br/>[ui.py]"]
  node_map["Camera map<br/>[location.py]"]
  node_config["Surveillance config<br/>[config.py]"]
end

node_operator(("Security operator"))
node_cameras(("CCTV sources"))

node_cameras -->|"provide video"| node_sources
node_sources -->|"opens streams"| node_network
node_pipeline -->|"opens source"| node_sources
node_pipeline -->|"processes frames"| node_detector
node_detector -->|"uses labels"| node_classes
node_pipeline -->|"tracks detections"| node_tracking
node_tracking -->|"uses detections"| node_detector
node_pipeline -->|"checks membership"| node_zones
node_zones -->|"tests polygons"| node_geometry
node_pipeline -->|"measures tracks"| node_context
node_context -->|"locates zones"| node_zones
node_context -->|"updates history"| node_history
node_context -->|"uses ground plane"| node_calibration
node_pipeline -->|"classifies behavior"| node_behaviour
node_behaviour -->|"reads context"| node_context
node_pipeline -->|"scores threat"| node_risk
node_risk -->|"uses behaviors"| node_behaviour
node_risk -->|"uses measurements"| node_context
node_pipeline -->|"recognizes people"| node_faces
node_faces -->|"checks enrollment"| node_roster
node_pipeline -->|"follows appearances"| node_people
node_pipeline -->|"reads plates"| node_anpr
node_anpr -->|"pools reads"| node_ledger
node_pipeline -->|"checks registration"| node_registry
node_pipeline -->|"confirms alerts"| node_events
node_pipeline -->|"captures clips"| node_clips
node_pipeline -->|"persists events"| node_store
node_runner -->|"runs cameras"| node_pipeline
node_runner -->|"shares store"| node_store
node_operator -->|"uses API"| node_api
node_operator -->|"views surveillance"| node_dashboard
node_api -->|"manages fleet"| node_runner
node_api -->|"edits fences"| node_zones
node_api -->|"updates locations"| node_map
node_runner -->|"loads settings"| node_config
node_operator -->|"configures cameras"| node_config

click node_sources "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/video/sources.py"
click node_network "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/video/stream.py"
click node_detector "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/detection/yolo.py"
click node_tracking "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/detection/tracker.py"
click node_classes "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/detection/classes.py"
click node_zones "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/zones/manager.py"
click node_geometry "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/zones/geometry.py"
click node_context "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/context/engine.py"
click node_history "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/context/history.py"
click node_calibration "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/calibration.py"
click node_behaviour "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/behaviour/engine.py"
click node_risk "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/risk/engine.py"
click node_faces "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/faces/engine.py"
click node_roster "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/faces/roster.py"
click node_people "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/tracking/people.py"
click node_anpr "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/anpr/engine.py"
click node_ledger "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/anpr/ledger.py"
click node_registry "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/registry/vehicles.py"
click node_pipeline "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/pipeline.py"
click node_events "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/alerts/events.py"
click node_clips "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/alerts/clips.py"
click node_store "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/store/database.py"
click node_runner "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/runner.py"
click node_api "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/server/api.py"
click node_dashboard "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/ui.py"
click node_map "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/geo/location.py"
click node_config "https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/config.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_sources,node_network,node_detector,node_tracking,node_classes toneBlue
class node_zones,node_geometry,node_context,node_history,node_calibration,node_behaviour,node_risk toneAmber
class node_faces,node_roster,node_people,node_anpr,node_ledger,node_registry toneMint
class node_pipeline,node_events,node_clips,node_store toneRose
class node_runner,node_api,node_dashboard,node_map,node_config,node_operator,node_cameras toneIndigo
```

## Components

### Video & Detection

- [Video sources](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/video/sources.py): `app/video/sources.py`
- [Network streaming](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/video/stream.py): `app/video/stream.py`
- [Object detection](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/detection/yolo.py): `app/detection/yolo.py`
- [Stable tracking](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/detection/tracker.py): `app/detection/tracker.py`
- [Object classes](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/detection/classes.py): `app/detection/classes.py`

### Threat Analysis

- [Virtual fences](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/zones/manager.py): `app/zones/manager.py`
- [Zone geometry](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/zones/geometry.py): `app/zones/geometry.py`
- [Movement context](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/context/engine.py): `app/context/engine.py`
- [Track history](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/context/history.py): `app/context/history.py`
- [Camera calibration](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/calibration.py): `app/calibration.py`
- [Behavior analysis](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/behaviour/engine.py): `app/behaviour/engine.py`
- [Risk scoring](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/risk/engine.py): `app/risk/engine.py`

### Identity & Vehicles

- [Face recognition](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/faces/engine.py): `app/faces/engine.py`
- [Guard roster](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/faces/roster.py): `app/faces/roster.py`
- [Person following](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/tracking/people.py): `app/tracking/people.py`
- [Plate recognition](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/anpr/engine.py): `app/anpr/engine.py`
- [Plate ledger](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/anpr/ledger.py): `app/anpr/ledger.py`
- [Vehicle registry](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/registry/vehicles.py): `app/registry/vehicles.py`

### Alerts & Evidence

- [Surveillance pipeline](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/pipeline.py): `app/pipeline.py`
- [Alert confirmation](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/alerts/events.py): `app/alerts/events.py`
- [Evidence clips](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/alerts/clips.py): `app/alerts/clips.py`
- [Event database](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/store/database.py): `app/store/database.py`

### Fleet & Interface

- [Multi-camera runner](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/runner.py): `app/runner.py`
- [JSON API](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/server/api.py): `app/server/api.py`
- [Live dashboard](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/ui.py): `app/ui.py`
- [Camera map](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/geo/location.py): `app/geo/location.py`
- [Surveillance config](https://github.com/vinuah-dev/sih-tech-garuda/blob/main/app/config.py): `app/config.py`

### Other components

- **Security operator**
- **CCTV sources**

## Connections

- CCTV sources → Video sources: provide video
- Video sources → Network streaming: opens streams (evidence: `app/video/sources.py`)
- Surveillance pipeline → Video sources: opens source (evidence: `app/pipeline.py`)
- Surveillance pipeline → Object detection: processes frames (evidence: `app/pipeline.py`)
- Object detection → Object classes: uses labels (evidence: `app/detection/classes.py`)
- Surveillance pipeline → Stable tracking: tracks detections (evidence: `app/pipeline.py`)
- Stable tracking → Object detection: uses detections (evidence: `app/detection/tracker.py`)
- Surveillance pipeline → Virtual fences: checks membership (evidence: `app/pipeline.py`)
- Virtual fences → Zone geometry: tests polygons (evidence: `app/zones/manager.py`)
- Surveillance pipeline → Movement context: measures tracks (evidence: `app/pipeline.py`)
- Movement context → Virtual fences: locates zones (evidence: `app/context/engine.py`)
- Movement context → Track history: updates history (evidence: `app/context/engine.py`)
- Movement context → Camera calibration: uses ground plane (evidence: `app/context/engine.py`)
- Surveillance pipeline → Behavior analysis: classifies behavior (evidence: `app/pipeline.py`)
- Behavior analysis → Movement context: reads context (evidence: `app/behaviour/engine.py`)
- Surveillance pipeline → Risk scoring: scores threat (evidence: `app/pipeline.py`)
- Risk scoring → Behavior analysis: uses behaviors (evidence: `app/risk/engine.py`)
- Risk scoring → Movement context: uses measurements (evidence: `app/risk/engine.py`)
- Surveillance pipeline → Face recognition: recognizes people (evidence: `app/pipeline.py`)
- Face recognition → Guard roster: checks enrollment (evidence: `app/faces/engine.py`)
- Surveillance pipeline → Person following: follows appearances (evidence: `app/pipeline.py`)
- Surveillance pipeline → Plate recognition: reads plates (evidence: `app/pipeline.py`)
- Plate recognition → Plate ledger: pools reads (evidence: `app/anpr/engine.py`)
- Surveillance pipeline → Vehicle registry: checks registration (evidence: `app/pipeline.py`)
- Surveillance pipeline → Alert confirmation: confirms alerts (evidence: `app/pipeline.py`)
- Surveillance pipeline → Evidence clips: captures clips (evidence: `app/pipeline.py`)
- Surveillance pipeline → Event database: persists events (evidence: `app/pipeline.py`)
- Multi-camera runner → Surveillance pipeline: runs cameras (evidence: `app/runner.py`)
- Multi-camera runner → Event database: shares store (evidence: `app/runner.py`)
- Security operator → JSON API: uses API
- Security operator → Live dashboard: views surveillance
- JSON API → Multi-camera runner: manages fleet (evidence: `app/server/api.py`)
- JSON API → Virtual fences: edits fences (evidence: `app/server/api.py`)
- JSON API → Camera map: updates locations
- Multi-camera runner → Surveillance config: loads settings (evidence: `app/runner.py`)
- Security operator → Surveillance config: configures cameras
