# bastendekoninck/football-vision architecture

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

- Interactive diagram: https://gitdiagram.com/bastendekoninck/football-vision
- Repository: https://github.com/bastendekoninck/football-vision

## Overview

football-vision processes match footage through detection, pitch-based filtering, jersey-colour classification, and count validation. The Pipeline owns the runtime sequence and returns classified detections plus validation metrics. The extractor and filter/classifier relationships are supported by their source excerpts; the user-facing setup and returned outputs are documented in the README. The graph focuses on these product stages rather than packaging or development tooling.

Main entry points: [`src/football_vision/pipeline.py`](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/pipeline.py) (Pipeline), [`src/football_vision/detection.py`](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/detection.py) (YOLO Detector), [`src/football_vision/filter.py`](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/filter.py) (Pitch Filter), [`src/football_vision/classifier.py`](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/classifier.py) (GMM Classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_pipeline["Pipeline<br/>[pipeline.py]"]
end

subgraph group_detection["Detection"]
  node_yolo["YOLO Detector<br/>[detection.py]"]
  node_detections["Detections<br/>[detection.py]"]
end

subgraph group_pitch["Pitch Processing"]
  node_pitch_filter["Pitch Filter<br/>[filter.py]"]
  node_pitch_extractor["Pitch Mask Extractor<br/>[pitch_mask.py]"]
end

subgraph group_analysis["Classification And Validation"]
  node_gmm["GMM Classifier<br/>[classifier.py]"]
  node_feature_extractor["Jersey Feature Extractor<br/>[classifier.py]"]
  node_ground_truth["Frame Ground Truth<br/>[validation.py]"]
  node_validator["Count Validator<br/>[validation.py]"]
  node_results["Classifications And Metrics<br/>[validation.py]"]
end

node_user(("Engineer"))
node_footage["Match Footage"]

node_user -->|"configures and runs"| node_pipeline
node_pipeline -->|"requests detections"| node_yolo
node_footage -->|"provides frames"| node_yolo
node_yolo -->|"yields"| node_detections
node_pipeline -->|"applies filters"| node_pitch_filter
node_pitch_filter -->|"extracts masks"| node_pitch_extractor
node_pipeline -->|"classifies detections"| node_gmm
node_gmm -->|"gets features"| node_feature_extractor
node_feature_extractor -->|"extracts masks"| node_pitch_extractor
node_pipeline -->|"validates counts"| node_validator
node_ground_truth -->|"supplies counts"| node_validator
node_pipeline -->|"returns results"| node_results
node_user -->|"provides source"| node_footage

click node_pipeline "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/pipeline.py"
click node_yolo "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/detection.py"
click node_detections "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/detection.py"
click node_pitch_filter "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/filter.py"
click node_pitch_extractor "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/pitch_mask.py"
click node_gmm "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/classifier.py"
click node_feature_extractor "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/classifier.py"
click node_ground_truth "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/validation.py"
click node_validator "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/validation.py"
click node_results "https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/validation.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_pipeline toneBlue
class node_yolo,node_detections toneAmber
class node_pitch_filter,node_pitch_extractor toneMint
class node_gmm,node_feature_extractor,node_ground_truth,node_validator,node_results toneRose
class node_user,node_footage toneIndigo
```

## Components

### Orchestration

- [Pipeline](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/pipeline.py): `src/football_vision/pipeline.py`

### Detection

- [YOLO Detector](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/detection.py): `src/football_vision/detection.py`
- [Detections](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/detection.py): `src/football_vision/detection.py`

### Pitch Processing

- [Pitch Filter](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/filter.py): `src/football_vision/filter.py`
- [Pitch Mask Extractor](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/pitch_mask.py): `src/football_vision/pitch_mask.py`

### Classification And Validation

- [GMM Classifier](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/classifier.py): `src/football_vision/classifier.py`
- [Jersey Feature Extractor](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/classifier.py): `src/football_vision/classifier.py`
- [Frame Ground Truth](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/validation.py): `src/football_vision/validation.py`
- [Count Validator](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/validation.py): `src/football_vision/validation.py`
- [Classifications And Metrics](https://github.com/bastendekoninck/football-vision/blob/main/src/football_vision/validation.py): `src/football_vision/validation.py`

### Other components

- **Engineer**
- **Match Footage**

## Connections

- Engineer → Pipeline: configures and runs (evidence: `README.md`)
- Pipeline → YOLO Detector: requests detections (evidence: `src/football_vision/pipeline.py`)
- Match Footage → YOLO Detector: provides frames (evidence: `README.md`)
- YOLO Detector → Detections: yields (evidence: `src/football_vision/detection.py`)
- Pipeline → Pitch Filter: applies filters (evidence: `src/football_vision/pipeline.py`)
- Pitch Filter → Pitch Mask Extractor: extracts masks (evidence: `src/football_vision/filter.py`)
- Pipeline → GMM Classifier: classifies detections (evidence: `src/football_vision/pipeline.py`)
- GMM Classifier → Jersey Feature Extractor: gets features (evidence: `src/football_vision/classifier.py`)
- Jersey Feature Extractor → Pitch Mask Extractor: extracts masks (evidence: `src/football_vision/classifier.py`)
- Pipeline → Count Validator: validates counts (evidence: `src/football_vision/pipeline.py`)
- Frame Ground Truth → Count Validator: supplies counts (evidence: `README.md`)
- Pipeline → Classifications And Metrics: returns results (evidence: `src/football_vision/pipeline.py`)
- Engineer → Match Footage: provides source (evidence: `README.md`)
