# ganatuka/dataproj1 architecture

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

- Interactive diagram: https://gitdiagram.com/ganatuka/dataproj1
- Repository: https://github.com/ganatuka/dataproj1

## Overview

Mongolia 3x3 is a local basketball-video analysis workspace. A user registers a match and video, starts or resumes a generation, and the runner analyzes source frames through vision and scoreboard stages, reviews and verifies event candidates, then stores evidence and presents summaries. Supporting capabilities include detector-data export, evaluation, and CLI access. Edges follow shown calls or source-index references; the README is empty and several implementation details were not sampled, so uncertain wiring is omitted.

Main entry points: [`mongolia_3x3/basket3x3/autonomous.py`](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/autonomous.py) (Analysis runner), [`mongolia_3x3/app.py`](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/app.py) (Streamlit workspace), [`mongolia_3x3/basket3x3/tracking.py`](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/tracking.py) (Object tracking), [`mongolia_3x3/basket3x3/cli.py`](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/cli.py) (Command line)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Match workspace"]
  node_app["Streamlit workspace<br/>[app.py]"]
  node_hardware["Local preflight<br/>[hardware.py]"]
end

subgraph group_analysis["Video analysis"]
  node_runner["Analysis runner<br/>[autonomous.py]"]
  node_video["Video utilities<br/>[video.py]"]
  node_vision["Local vision inference<br/>[vision_provider.py]"]
  node_scenes["Scene detection<br/>[scenes.py]"]
  node_manifest["Frame manifest<br/>[frame_manifest.py]"]
  node_tracking["Object tracking<br/>[tracking.py]"]
  node_jerseys["Jersey matching<br/>[jerseys.py]"]
  node_scoreboard["Scoreboard OCR<br/>[scoreboard.py]"]
end

subgraph group_review["Event review"]
  node_verification["Event verification<br/>[verification.py]"]
  node_offline["Event reconstruction<br/>[offline_events.py]"]
  node_review["Review validation<br/>[review.py]"]
  node_plays["Play analysis<br/>[plays.py]"]
end

subgraph group_data["Evidence and data"]
  node_store[("Generation store<br/>[generation.py]")]
  node_summary["Generation summary<br/>[summary.py]"]
  node_evaluation["Accuracy evaluation<br/>[evaluation.py]"]
  node_dataset["Detector data export<br/>[dataset.py]"]
end

subgraph group_access["User access"]
  node_cli["Command line<br/>[cli.py]"]
end

node_user(("Analyst"))

node_user -->|"configures analysis"| node_app
node_app -->|"opens database"| node_store
node_app -->|"starts analysis"| node_runner
node_app -->|"checks readiness"| node_hardware
node_app -->|"shows metrics"| node_summary
node_runner -->|"records evidence"| node_store
node_runner -->|"reads source"| node_video
node_runner -->|"requests observations"| node_vision
node_runner -->|"detects scenes"| node_scenes
node_runner -->|"records frames"| node_manifest
node_runner -->|"tracks objects"| node_tracking
node_runner -->|"reads scoreboard"| node_scoreboard
node_runner -->|"reconstructs events"| node_offline
node_runner -->|"verifies candidates"| node_verification
node_tracking -->|"reads frames"| node_video
node_tracking -->|"uses inference"| node_vision
node_tracking -->|"matches jerseys"| node_jerseys
node_scoreboard -->|"validates clock"| node_review
node_verification -->|"checks score evidence"| node_scoreboard
node_dataset -->|"reads generation data"| node_store
node_dataset -->|"aligns source frames"| node_video
node_cli -->|"runs analysis"| node_runner
node_cli -->|"evaluates results"| node_evaluation
node_cli -->|"prints summary"| node_summary

click node_app "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/app.py"
click node_runner "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/autonomous.py"
click node_store "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/generation.py"
click node_video "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/video.py"
click node_vision "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/vision_provider.py"
click node_scenes "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/scenes.py"
click node_manifest "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/frame_manifest.py"
click node_tracking "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/tracking.py"
click node_jerseys "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/jerseys.py"
click node_scoreboard "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/scoreboard.py"
click node_verification "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/verification.py"
click node_offline "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/offline_events.py"
click node_review "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/review.py"
click node_plays "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/plays.py"
click node_summary "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/summary.py"
click node_evaluation "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/evaluation.py"
click node_dataset "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/dataset.py"
click node_hardware "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/hardware.py"
click node_cli "https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/cli.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_app,node_hardware toneBlue
class node_runner,node_video,node_vision,node_scenes,node_manifest,node_tracking,node_jerseys,node_scoreboard toneAmber
class node_verification,node_offline,node_review,node_plays toneMint
class node_store,node_summary,node_evaluation,node_dataset toneRose
class node_cli,node_user toneIndigo
```

## Components

### Match workspace

- [Streamlit workspace](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/app.py): `mongolia_3x3/app.py`
- [Local preflight](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/hardware.py): `mongolia_3x3/basket3x3/hardware.py`

### Video analysis

- [Analysis runner](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/autonomous.py): `mongolia_3x3/basket3x3/autonomous.py`
- [Video utilities](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/video.py): `mongolia_3x3/basket3x3/video.py`
- [Local vision inference](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/vision_provider.py): `mongolia_3x3/basket3x3/vision_provider.py`
- [Scene detection](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/scenes.py): `mongolia_3x3/basket3x3/scenes.py`
- [Frame manifest](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/frame_manifest.py): `mongolia_3x3/basket3x3/frame_manifest.py`
- [Object tracking](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/tracking.py): `mongolia_3x3/basket3x3/tracking.py`
- [Jersey matching](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/jerseys.py): `mongolia_3x3/basket3x3/jerseys.py`
- [Scoreboard OCR](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/scoreboard.py): `mongolia_3x3/basket3x3/scoreboard.py`

### Event review

- [Event verification](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/verification.py): `mongolia_3x3/basket3x3/verification.py`
- [Event reconstruction](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/offline_events.py): `mongolia_3x3/basket3x3/offline_events.py`
- [Review validation](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/review.py): `mongolia_3x3/basket3x3/review.py`
- [Play analysis](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/plays.py): `mongolia_3x3/basket3x3/plays.py`

### Evidence and data

- [Generation store](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/generation.py): `mongolia_3x3/basket3x3/generation.py`
- [Generation summary](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/summary.py): `mongolia_3x3/basket3x3/summary.py`
- [Accuracy evaluation](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/evaluation.py): `mongolia_3x3/basket3x3/evaluation.py`
- [Detector data export](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/dataset.py): `mongolia_3x3/basket3x3/dataset.py`

### User access

- [Command line](https://github.com/ganatuka/dataproj1/blob/main/mongolia_3x3/basket3x3/cli.py): `mongolia_3x3/basket3x3/cli.py`

### Other components

- **Analyst**

## Connections

- Analyst → Streamlit workspace: configures analysis (evidence: `mongolia_3x3/app.py`)
- Streamlit workspace → Generation store: opens database (evidence: `mongolia_3x3/app.py`)
- Streamlit workspace → Analysis runner: starts analysis (evidence: `mongolia_3x3/app.py`)
- Streamlit workspace → Local preflight: checks readiness (evidence: `mongolia_3x3/app.py`)
- Streamlit workspace → Generation summary: shows metrics (evidence: `mongolia_3x3/app.py`)
- Analysis runner → Generation store: records evidence (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Analysis runner → Video utilities: reads source (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Analysis runner → Local vision inference: requests observations (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Analysis runner → Scene detection: detects scenes (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Analysis runner → Frame manifest: records frames (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Analysis runner → Object tracking: tracks objects (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Analysis runner → Scoreboard OCR: reads scoreboard (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Analysis runner → Event reconstruction: reconstructs events (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Analysis runner → Event verification: verifies candidates (evidence: `mongolia_3x3/basket3x3/autonomous.py`)
- Object tracking → Video utilities: reads frames (evidence: `mongolia_3x3/basket3x3/tracking.py`)
- Object tracking → Local vision inference: uses inference (evidence: `mongolia_3x3/basket3x3/tracking.py`)
- Object tracking → Jersey matching: matches jerseys (evidence: `mongolia_3x3/basket3x3/tracking.py`)
- Scoreboard OCR → Review validation: validates clock (evidence: `mongolia_3x3/basket3x3/scoreboard.py`)
- Event verification → Scoreboard OCR: checks score evidence (evidence: `mongolia_3x3/basket3x3/verification.py`)
- Detector data export → Generation store: reads generation data (evidence: `mongolia_3x3/basket3x3/dataset.py`)
- Detector data export → Video utilities: aligns source frames (evidence: `mongolia_3x3/basket3x3/dataset.py`)
- Command line → Analysis runner: runs analysis (evidence: `mongolia_3x3/basket3x3/cli.py`)
- Command line → Accuracy evaluation: evaluates results (evidence: `mongolia_3x3/basket3x3/cli.py`)
- Command line → Generation summary: prints summary (evidence: `mongolia_3x3/basket3x3/cli.py`)
