# deepandreinforcement/speed-calculation architecture

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

- Interactive diagram: https://gitdiagram.com/deepandreinforcement/speed-calculation
- Repository: https://github.com/deepandreinforcement/speed-calculation

## Overview

This tree contains YOLOv7 object detection and training/export code alongside a separate Deep SORT multi-object tracker and a Triton inference client. The likely video workflow is frame input, YOLO detection, then tracking and visualization, but the supplied README only links a video and no sampled source establishes a YOLO-to-Deep-SORT handoff; that connection is therefore omitted. The graph shows the independently evidenced workflows and deployment capability. Some subsystem links are based on SOURCE INDEX references rather than inspected call sites.

Main entry points: [`yolov7/train.py`](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/train.py) (Training runner), [`yolov7/detect.py`](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/detect.py) (Detection runner), [`deep_sort/deep_sort_app.py`](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort_app.py) (Tracking application), [`deep_sort/deep_sort/tracker.py`](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/tracker.py) (Track association)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_yolo_infer["YOLO inference"]
  node_detect["Detection runner<br/>[detect.py]"]
  node_export["Model exporter<br/>[export.py]"]
end

subgraph group_yolo_train["YOLO training"]
  node_train["Training runner<br/>[train.py]"]
  node_loss["Detection losses<br/>[loss.py]"]
  node_anchors["Anchor fitting<br/>[autoanchor.py]"]
  node_metrics["Evaluation metrics<br/>[metrics.py]"]
  node_wandb["W&amp;B logging<br/>[wandb_utils.py]"]
end

subgraph group_yolo_model["Model and utilities"]
  node_loaders["Inference loaders<br/>[datasets.py]"]
  node_model["YOLO architecture<br/>[yolo.py]"]
  node_model_components["Model components<br/>[common.py]"]
  node_experimental["Ensemble and export models<br/>[experimental.py]"]
  node_general["Detection utilities<br/>[general.py]"]
  node_torch_utils["Torch utilities<br/>[torch_utils.py]"]
  node_plots["Detection visualization<br/>[plots.py]"]
end

subgraph group_tracking["Deep SORT tracking"]
  node_tracker_app["Tracking application<br/>[deep_sort_app.py]"]
  node_preprocessing["Detection suppression<br/>[preprocessing.py]"]
  node_detection["Detection records<br/>[detection.py]"]
  node_tracker["Track association<br/>[tracker.py]"]
  node_kalman["Motion filtering<br/>[kalman_filter.py]"]
  node_assignment["Assignment solver"]
  node_iou["IoU matching<br/>[iou_matching.py]"]
  node_nn_matching["Appearance matching<br/>[nn_matching.py]"]
  node_track["Track state<br/>[track.py]"]
  node_visualization["Tracking display<br/>[visualization.py]"]
  node_image_viewer["Image viewer<br/>[image_viewer.py]"]
end

subgraph group_deployment["Triton deployment"]
  node_triton_client["Triton client<br/>[client.py]"]
  node_triton_processing["Request processing<br/>[processing.py]"]
  node_triton_render["Result rendering<br/>[render.py]"]
  node_triton_labels["Class labels<br/>[labels.py]"]
end

node_user(("Operator"))
node_video["Image or video"]
node_triton_server["Triton server"]

node_user -->|"runs"| node_detect
node_video -->|"provides frames"| node_loaders
node_detect -->|"loads input"| node_loaders
node_detect -->|"runs inference"| node_model
node_detect -->|"filters detections"| node_general
node_detect -->|"renders results"| node_plots
node_detect -->|"selects device"| node_torch_utils
node_model -->|"uses layers"| node_model_components
node_model -->|"uses modules"| node_experimental
node_user -->|"starts training"| node_train
node_train -->|"loads batches"| node_loaders
node_train -->|"builds model"| node_model
node_train -->|"computes loss"| node_loss
node_train -->|"checks anchors"| node_anchors
node_train -->|"checks dataset"| node_general
node_train -->|"plots training"| node_plots
node_train -->|"uses utilities"| node_torch_utils
node_train -.->|"logs runs"| node_wandb
node_train -.->|"evaluates model"| node_metrics
node_loss -->|"uses box metrics"| node_general
node_loss -->|"checks parallelism"| node_torch_utils
node_user -->|"exports model"| node_export
node_export -->|"loads model"| node_experimental
node_export -->|"uses export utilities"| node_general
node_user -->|"submits input"| node_triton_client
node_triton_client -->|"processes input"| node_triton_processing
node_triton_client -->|"renders output"| node_triton_render
node_triton_client -->|"loads labels"| node_triton_labels
node_triton_processing -.->|"sends inference"| node_triton_server
node_user -->|"runs sequence"| node_tracker_app
node_tracker_app -->|"suppresses overlaps"| node_preprocessing
node_tracker_app -->|"creates detections"| node_detection
node_tracker_app -->|"configures metric"| node_nn_matching
node_tracker_app -->|"updates tracks"| node_tracker
node_tracker_app -->|"displays results"| node_visualization
node_tracker -->|"predicts motion"| node_kalman
node_tracker -->|"solves matches"| node_assignment
node_tracker -->|"matches overlap"| node_iou
node_tracker -->|"updates state"| node_track
node_iou -->|"assigns costs"| node_assignment
node_assignment -->|"gates matches"| node_kalman
node_visualization -->|"uses viewer"| node_image_viewer

click node_detect "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/detect.py"
click node_loaders "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/datasets.py"
click node_model "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/models/yolo.py"
click node_model_components "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/models/common.py"
click node_experimental "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/models/experimental.py"
click node_general "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/general.py"
click node_torch_utils "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/torch_utils.py"
click node_plots "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/plots.py"
click node_train "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/train.py"
click node_loss "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/loss.py"
click node_anchors "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/autoanchor.py"
click node_metrics "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/metrics.py"
click node_wandb "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/wandb_logging/wandb_utils.py"
click node_export "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/export.py"
click node_triton_client "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/deploy/triton-inference-server/client.py"
click node_triton_processing "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/deploy/triton-inference-server/processing.py"
click node_triton_render "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/deploy/triton-inference-server/render.py"
click node_triton_labels "https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/deploy/triton-inference-server/labels.py"
click node_tracker_app "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort_app.py"
click node_preprocessing "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/application_util/preprocessing.py"
click node_detection "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/detection.py"
click node_tracker "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/tracker.py"
click node_kalman "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/kalman_filter.py"
click node_assignment "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/linear_assignment.py"
click node_iou "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/iou_matching.py"
click node_nn_matching "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/nn_matching.py"
click node_track "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/track.py"
click node_visualization "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/application_util/visualization.py"
click node_image_viewer "https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/application_util/image_viewer.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_detect,node_export toneBlue
class node_train,node_loss,node_anchors,node_metrics,node_wandb toneAmber
class node_loaders,node_model,node_model_components,node_experimental,node_general,node_torch_utils,node_plots,node_triton_server toneMint
class node_tracker_app,node_preprocessing,node_detection,node_tracker,node_kalman,node_assignment,node_iou,node_nn_matching,node_track,node_visualization,node_image_viewer toneRose
class node_triton_client,node_triton_processing,node_triton_render,node_triton_labels,node_user,node_video toneIndigo
```

## Components

### YOLO inference

- [Detection runner](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/detect.py): `yolov7/detect.py`
- [Model exporter](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/export.py): `yolov7/export.py`

### YOLO training

- [Training runner](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/train.py): `yolov7/train.py`
- [Detection losses](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/loss.py): `yolov7/utils/loss.py`
- [Anchor fitting](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/autoanchor.py): `yolov7/utils/autoanchor.py`
- [Evaluation metrics](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/metrics.py): `yolov7/utils/metrics.py`
- [W&B logging](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/wandb_logging/wandb_utils.py): `yolov7/utils/wandb_logging/wandb_utils.py`

### Model and utilities

- [Inference loaders](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/datasets.py): `yolov7/utils/datasets.py`
- [YOLO architecture](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/models/yolo.py): `yolov7/models/yolo.py`
- [Model components](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/models/common.py): `yolov7/models/common.py`
- [Ensemble and export models](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/models/experimental.py): `yolov7/models/experimental.py`
- [Detection utilities](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/general.py): `yolov7/utils/general.py`
- [Torch utilities](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/torch_utils.py): `yolov7/utils/torch_utils.py`
- [Detection visualization](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/utils/plots.py): `yolov7/utils/plots.py`

### Deep SORT tracking

- [Tracking application](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort_app.py): `deep_sort/deep_sort_app.py`
- [Detection suppression](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/application_util/preprocessing.py): `deep_sort/application_util/preprocessing.py`
- [Detection records](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/detection.py): `deep_sort/deep_sort/detection.py`
- [Track association](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/tracker.py): `deep_sort/deep_sort/tracker.py`
- [Motion filtering](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/kalman_filter.py): `deep_sort/deep_sort/kalman_filter.py`
- [Assignment solver](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/linear_assignment.py): `deep_sort/deep_sort/linear_assignment.py`
- [IoU matching](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/iou_matching.py): `deep_sort/deep_sort/iou_matching.py`
- [Appearance matching](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/nn_matching.py): `deep_sort/deep_sort/nn_matching.py`
- [Track state](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/deep_sort/track.py): `deep_sort/deep_sort/track.py`
- [Tracking display](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/application_util/visualization.py): `deep_sort/application_util/visualization.py`
- [Image viewer](https://github.com/deepandreinforcement/speed-calculation/blob/main/deep_sort/application_util/image_viewer.py): `deep_sort/application_util/image_viewer.py`

### Triton deployment

- [Triton client](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/deploy/triton-inference-server/client.py): `yolov7/deploy/triton-inference-server/client.py`
- [Request processing](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/deploy/triton-inference-server/processing.py): `yolov7/deploy/triton-inference-server/processing.py`
- [Result rendering](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/deploy/triton-inference-server/render.py): `yolov7/deploy/triton-inference-server/render.py`
- [Class labels](https://github.com/deepandreinforcement/speed-calculation/blob/main/yolov7/deploy/triton-inference-server/labels.py): `yolov7/deploy/triton-inference-server/labels.py`

### Other components

- **Operator**
- **Image or video**
- **Triton server**

## Connections

- Operator → Detection runner: runs (evidence: `yolov7/detect.py`)
- Image or video → Inference loaders: provides frames (evidence: `yolov7/utils/datasets.py`)
- Detection runner → Inference loaders: loads input (evidence: `yolov7/detect.py`)
- Detection runner → YOLO architecture: runs inference (evidence: `yolov7/detect.py`)
- Detection runner → Detection utilities: filters detections (evidence: `yolov7/detect.py`)
- Detection runner → Detection visualization: renders results (evidence: `yolov7/detect.py`)
- Detection runner → Torch utilities: selects device (evidence: `yolov7/detect.py`)
- YOLO architecture → Model components: uses layers (evidence: `yolov7/models/yolo.py`)
- YOLO architecture → Ensemble and export models: uses modules (evidence: `yolov7/models/yolo.py`)
- Operator → Training runner: starts training (evidence: `yolov7/train.py`)
- Training runner → Inference loaders: loads batches (evidence: `yolov7/train.py`)
- Training runner → YOLO architecture: builds model (evidence: `yolov7/train.py`)
- Training runner → Detection losses: computes loss (evidence: `yolov7/train.py`)
- Training runner → Anchor fitting: checks anchors (evidence: `yolov7/train.py`)
- Training runner → Detection utilities: checks dataset (evidence: `yolov7/train.py`)
- Training runner → Detection visualization: plots training (evidence: `yolov7/train.py`)
- Training runner → Torch utilities: uses utilities (evidence: `yolov7/train.py`)
- Training runner → W&B logging: logs runs (evidence: `yolov7/train.py`)
- Training runner → Evaluation metrics: evaluates model (evidence: `yolov7/train.py`)
- Detection losses → Detection utilities: uses box metrics (evidence: `yolov7/utils/loss.py`)
- Detection losses → Torch utilities: checks parallelism (evidence: `yolov7/utils/loss.py`)
- Operator → Model exporter: exports model (evidence: `yolov7/export.py`)
- Model exporter → Ensemble and export models: loads model (evidence: `yolov7/export.py`)
- Model exporter → Detection utilities: uses export utilities (evidence: `yolov7/export.py`)
- Operator → Triton client: submits input (evidence: `yolov7/deploy/triton-inference-server/client.py`)
- Triton client → Request processing: processes input (evidence: `yolov7/deploy/triton-inference-server/client.py`)
- Triton client → Result rendering: renders output (evidence: `yolov7/deploy/triton-inference-server/client.py`)
- Triton client → Class labels: loads labels (evidence: `yolov7/deploy/triton-inference-server/client.py`)
- Request processing → Triton server: sends inference
- Operator → Tracking application: runs sequence (evidence: `deep_sort/deep_sort_app.py`)
- Tracking application → Detection suppression: suppresses overlaps (evidence: `deep_sort/deep_sort_app.py`)
- Tracking application → Detection records: creates detections (evidence: `deep_sort/deep_sort_app.py`)
- Tracking application → Appearance matching: configures metric (evidence: `deep_sort/deep_sort_app.py`)
- Tracking application → Track association: updates tracks (evidence: `deep_sort/deep_sort_app.py`)
- Tracking application → Tracking display: displays results (evidence: `deep_sort/deep_sort_app.py`)
- Track association → Motion filtering: predicts motion (evidence: `deep_sort/deep_sort/tracker.py`)
- Track association → Assignment solver: solves matches (evidence: `deep_sort/deep_sort/tracker.py`)
- Track association → IoU matching: matches overlap (evidence: `deep_sort/deep_sort/tracker.py`)
- Track association → Track state: updates state (evidence: `deep_sort/deep_sort/tracker.py`)
- IoU matching → Assignment solver: assigns costs (evidence: `deep_sort/deep_sort/iou_matching.py`)
- Assignment solver → Motion filtering: gates matches (evidence: `deep_sort/deep_sort/linear_assignment.py`)
- Tracking display → Image viewer: uses viewer (evidence: `deep_sort/application_util/visualization.py`)
