# nezarsheikhi/resource-efficient-mtmc architecture

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

- Interactive diagram: https://gitdiagram.com/nezarsheikhi/resource-efficient-mtmc
- Repository: https://github.com/nezarsheikhi/resource-efficient-mtmc

## Overview

This is a Python multi-camera people-tracking system for assigning consistent global identities across non-overlapping video feeds. Users provide videos and tracking settings through the CLI, web UI, or Python API; the pipeline runs per-camera detection and tracking, extracts appearance embeddings, and matches them through a shared identity gallery. Results include per-camera MOT tracks, optional annotated videos, run metadata, and evaluation metrics. The README also documents model-weight and example-video downloads. Several subsystem links are supported by the source index rather than full excerpts, so those relationships are limited to its import references and README statements.

Main entry points: [`src/mtmc_tracking/pipeline.py`](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/pipeline.py) (Tracking pipeline), [`src/mtmc_tracking/cli.py`](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/cli.py) (CLI), [`src/mtmc_tracking/camera.py`](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/camera.py) (Camera worker), [`src/mtmc_tracking/ui.py`](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/ui.py) (Web UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["CLI<br/>[cli.py]"]
  node_web["Web UI<br/>[ui.py]"]
  node_api["Python API<br/>[__init__.py]"]
end

subgraph group_tracking["Tracking and identity"]
  node_pipeline["Tracking pipeline<br/>[pipeline.py]"]
  node_camera["Camera worker<br/>[camera.py]"]
  node_detector["YOLO and ByteTrack"]
  node_gallery[("Global gallery<br/>[gallery.py]")]
  node_geometry["Box geometry<br/>[geometry.py]"]
  node_kalman["Motion prediction<br/>[kalman.py]"]
end

subgraph group_models["Models and settings"]
  node_config["Configuration<br/>[config.py]"]
  node_presets["Config presets"]
  node_weights["Weight manager<br/>[weights.py]"]
  node_extractor["Re-ID extractor<br/>[reid.py]"]
  node_osnet["OSNet backbone<br/>[osnet.py]"]
end

subgraph group_results["Results and evaluation"]
  node_tracks["Track outputs<br/>[pipeline.py]"]
  node_summary["Run summary<br/>[summary.py]"]
  node_evaluation["Metrics evaluation<br/>[evaluation.py]"]
end

node_operator(("Operator"))
node_release(("Model releases"))
node_groundtruth["Ground truth"]

node_operator -->|"runs commands"| node_cli
node_operator -->|"uses interface"| node_web
node_operator -->|"calls API"| node_api
node_cli -->|"loads settings"| node_config
node_cli -->|"starts tracking"| node_pipeline
node_cli -->|"runs evaluation"| node_evaluation
node_cli -->|"launches UI"| node_web
node_cli -->|"downloads weights"| node_weights
node_web -->|"starts tracking"| node_pipeline
node_web -->|"loads settings"| node_config
node_web -->|"formats results"| node_summary
node_web -->|"loads weights"| node_weights
node_api -->|"runs tracking"| node_pipeline
node_api -->|"evaluates tracks"| node_evaluation
node_config -->|"loads presets"| node_presets
node_weights -->|"downloads files"| node_release
node_pipeline -->|"starts workers"| node_camera
node_pipeline -->|"shares identities"| node_gallery
node_pipeline -->|"creates extractor"| node_extractor
node_pipeline -->|"writes tracks"| node_tracks
node_camera -->|"detects and tracks"| node_detector
node_camera -->|"extracts features"| node_extractor
node_camera -->|"requests identities"| node_gallery
node_camera -->|"uses box geometry"| node_geometry
node_camera -->|"predicts motion"| node_kalman
node_extractor -->|"uses backbone"| node_osnet
node_tracks -->|"provides predictions"| node_evaluation
node_groundtruth -->|"supplies reference"| node_evaluation
node_pipeline -->|"summarizes run"| node_summary

click node_cli "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/cli.py"
click node_web "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/ui.py"
click node_api "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/__init__.py"
click node_config "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/config.py"
click node_presets "https://github.com/nezarsheikhi/resource-efficient-mtmc/tree/main/src/mtmc_tracking/configs"
click node_weights "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/weights.py"
click node_pipeline "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/pipeline.py"
click node_camera "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/camera.py"
click node_gallery "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/gallery.py"
click node_geometry "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/geometry.py"
click node_kalman "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/kalman.py"
click node_extractor "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/reid.py"
click node_osnet "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/osnet.py"
click node_tracks "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/pipeline.py"
click node_summary "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/summary.py"
click node_evaluation "https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/evaluation.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_cli,node_web,node_api toneBlue
class node_pipeline,node_camera,node_detector,node_gallery,node_geometry,node_kalman toneAmber
class node_config,node_presets,node_weights,node_extractor,node_osnet toneMint
class node_tracks,node_summary,node_evaluation toneRose
class node_operator,node_release,node_groundtruth toneIndigo
```

## Components

### User entry points

- [CLI](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/cli.py): `src/mtmc_tracking/cli.py`
- [Web UI](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/ui.py): `src/mtmc_tracking/ui.py`
- [Python API](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/__init__.py): `src/mtmc_tracking/__init__.py`

### Tracking and identity

- [Tracking pipeline](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/pipeline.py): `src/mtmc_tracking/pipeline.py`
- [Camera worker](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/camera.py): `src/mtmc_tracking/camera.py`
- **YOLO and ByteTrack**
- [Global gallery](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/gallery.py): `src/mtmc_tracking/gallery.py`
- [Box geometry](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/geometry.py): `src/mtmc_tracking/geometry.py`
- [Motion prediction](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/kalman.py): `src/mtmc_tracking/kalman.py`

### Models and settings

- [Configuration](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/config.py): `src/mtmc_tracking/config.py`
- [Config presets](https://github.com/nezarsheikhi/resource-efficient-mtmc/tree/main/src/mtmc_tracking/configs): `src/mtmc_tracking/configs`
- [Weight manager](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/weights.py): `src/mtmc_tracking/weights.py`
- [Re-ID extractor](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/reid.py): `src/mtmc_tracking/reid.py`
- [OSNet backbone](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/osnet.py): `src/mtmc_tracking/osnet.py`

### Results and evaluation

- [Track outputs](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/pipeline.py): `src/mtmc_tracking/pipeline.py`
- [Run summary](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/summary.py): `src/mtmc_tracking/summary.py`
- [Metrics evaluation](https://github.com/nezarsheikhi/resource-efficient-mtmc/blob/main/src/mtmc_tracking/evaluation.py): `src/mtmc_tracking/evaluation.py`

### Other components

- **Operator**
- **Model releases**
- **Ground truth**

## Connections

- Operator → CLI: runs commands (evidence: `README.md`)
- Operator → Web UI: uses interface (evidence: `README.md`)
- Operator → Python API: calls API (evidence: `README.md`)
- CLI → Configuration: loads settings (evidence: `src/mtmc_tracking/cli.py`)
- CLI → Tracking pipeline: starts tracking (evidence: `src/mtmc_tracking/cli.py`)
- CLI → Metrics evaluation: runs evaluation (evidence: `src/mtmc_tracking/cli.py`)
- CLI → Web UI: launches UI (evidence: `src/mtmc_tracking/cli.py`)
- CLI → Weight manager: downloads weights (evidence: `src/mtmc_tracking/cli.py`)
- Web UI → Tracking pipeline: starts tracking (evidence: `src/mtmc_tracking/ui.py`)
- Web UI → Configuration: loads settings (evidence: `src/mtmc_tracking/ui.py`)
- Web UI → Run summary: formats results (evidence: `src/mtmc_tracking/ui.py`)
- Web UI → Weight manager: loads weights (evidence: `src/mtmc_tracking/ui.py`)
- Python API → Tracking pipeline: runs tracking (evidence: `README.md`)
- Python API → Metrics evaluation: evaluates tracks (evidence: `README.md`)
- Configuration → Config presets: loads presets (evidence: `src/mtmc_tracking/config.py`)
- Weight manager → Model releases: downloads files (evidence: `src/mtmc_tracking/weights.py`)
- Tracking pipeline → Camera worker: starts workers (evidence: `src/mtmc_tracking/pipeline.py`)
- Tracking pipeline → Global gallery: shares identities (evidence: `src/mtmc_tracking/pipeline.py`)
- Tracking pipeline → Re-ID extractor: creates extractor (evidence: `src/mtmc_tracking/pipeline.py`)
- Tracking pipeline → Track outputs: writes tracks (evidence: `src/mtmc_tracking/pipeline.py`)
- Camera worker → YOLO and ByteTrack: detects and tracks (evidence: `README.md`)
- Camera worker → Re-ID extractor: extracts features (evidence: `src/mtmc_tracking/camera.py`)
- Camera worker → Global gallery: requests identities (evidence: `src/mtmc_tracking/camera.py`)
- Camera worker → Box geometry: uses box geometry (evidence: `src/mtmc_tracking/camera.py`)
- Camera worker → Motion prediction: predicts motion (evidence: `src/mtmc_tracking/camera.py`)
- Re-ID extractor → OSNet backbone: uses backbone (evidence: `src/mtmc_tracking/reid.py`)
- Track outputs → Metrics evaluation: provides predictions (evidence: `README.md`)
- Ground truth → Metrics evaluation: supplies reference (evidence: `README.md`)
- Tracking pipeline → Run summary: summarizes run (evidence: `src/mtmc_tracking/summary.py`)
