# mehmet-sarikaya/skeleton-based-basketball-action-recognition architecture

> Architecture diagram of the GitHub repository mehmet-sarikaya/skeleton-based-basketball-action-recognition, 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/mehmet-sarikaya/skeleton-based-basketball-action-recognition
- Repository: https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition

## Overview

This is a Python application for recognizing basketball gestures from video using pose keypoints and temporal classification. Its main workflow is to extract and label skeleton data, prepare fixed-length windows, train a selected model with grouped validation, then classify video or camera input in real time. The README also describes augmentation and model comparisons. Edges follow shown imports and calls or README-described menu capabilities; unsampled implementation details are not inferred.

Main entry points: [`BasketballGestureRecognitionApp.py`](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/BasketballGestureRecognitionApp.py) (App menu), [`ModelCreator.py`](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/ModelCreator.py) (Model selection), [`ModelTester.py`](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/ModelTester.py) (Video and camera inference), [`KeypointDatasetProcessor.py`](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/KeypointDatasetProcessor.py) (Window preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Application workflow"]
  node_app["App menu"]
  node_trainer["Training and validation<br/>[ModelTrainer.py]"]
end

subgraph group_data["Pose data preparation"]
  node_dataset_creator["Dataset extraction"]
  node_video_processor["Video sampling<br/>[VideoProcessor.py]"]
  node_pose_detector["YOLO pose"]
  node_dataset_processor["Window preparation"]
  node_augmenter["Skeleton augmentation<br/>[Augmenter.py]"]
  node_skeleton_animator["Skeleton visualization"]
end

subgraph group_models["Gesture models"]
  node_model_creator["Model selection<br/>[ModelCreator.py]"]
  node_graph_model_creator["ST-GCN layers"]
  node_stgcn_model["ST-GCN classifier<br/>[stgcn_model.py]"]
  node_graph_definition["Skeleton graph<br/>[stgcn_graph.py]"]
  node_temporal_model["TCN attention model<br/>[tchm_model.py]"]
end

subgraph group_inference["Inference"]
  node_tester["Video and camera inference<br/>[ModelTester.py]"]
  node_predicted_gestures["Gesture labels"]
end

node_user(("Operator"))

node_user -->|"chooses mode"| node_app
node_app -->|"starts extraction"| node_dataset_creator
node_dataset_creator -->|"samples video"| node_video_processor
node_dataset_creator -->|"extracts poses"| node_pose_detector
node_app -->|"loads dataset"| node_dataset_processor
node_dataset_processor -->|"augments windows"| node_augmenter
node_dataset_processor -->|"visualizes windows"| node_skeleton_animator
node_app -->|"starts training"| node_trainer
node_trainer -->|"uses prepared data"| node_dataset_processor
node_trainer -->|"requests model"| node_model_creator
node_app -->|"selects architecture"| node_model_creator
node_model_creator -->|"builds ST-GCN"| node_graph_model_creator
node_model_creator -->|"selects classifier"| node_stgcn_model
node_stgcn_model -->|"constructs graph"| node_graph_definition
node_model_creator -->|"builds TCN model"| node_temporal_model
node_app -->|"starts inference"| node_tester
node_tester -->|"processes frames"| node_video_processor
node_tester -->|"tracks poses"| node_pose_detector
node_tester -->|"displays classifications"| node_predicted_gestures

click node_app "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/BasketballGestureRecognitionApp.py"
click node_dataset_creator "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/KeypointDatasetCreator.py"
click node_video_processor "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/VideoProcessor.py"
click node_dataset_processor "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/KeypointDatasetProcessor.py"
click node_augmenter "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/Augmenter.py"
click node_skeleton_animator "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/SkeletonAnimator.py"
click node_trainer "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/ModelTrainer.py"
click node_model_creator "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/ModelCreator.py"
click node_graph_model_creator "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/Graph_Model_Creator.py"
click node_stgcn_model "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/stgcn_model.py"
click node_graph_definition "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/stgcn_graph.py"
click node_temporal_model "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/tchm_model.py"
click node_tester "https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/ModelTester.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_trainer toneBlue
class node_dataset_creator,node_video_processor,node_pose_detector,node_dataset_processor,node_augmenter,node_skeleton_animator toneAmber
class node_model_creator,node_graph_model_creator,node_stgcn_model,node_graph_definition,node_temporal_model toneMint
class node_tester,node_predicted_gestures toneRose
class node_user toneIndigo
```

## Components

### Application workflow

- [App menu](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/BasketballGestureRecognitionApp.py): `BasketballGestureRecognitionApp.py`
- [Training and validation](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/ModelTrainer.py): `ModelTrainer.py`

### Pose data preparation

- [Dataset extraction](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/KeypointDatasetCreator.py): `KeypointDatasetCreator.py`
- [Video sampling](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/VideoProcessor.py): `VideoProcessor.py`
- **YOLO pose**
- [Window preparation](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/KeypointDatasetProcessor.py): `KeypointDatasetProcessor.py`
- [Skeleton augmentation](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/Augmenter.py): `Augmenter.py`
- [Skeleton visualization](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/SkeletonAnimator.py): `SkeletonAnimator.py`

### Gesture models

- [Model selection](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/ModelCreator.py): `ModelCreator.py`
- [ST-GCN layers](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/Graph_Model_Creator.py): `Graph_Model_Creator.py`
- [ST-GCN classifier](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/stgcn_model.py): `stgcn_model.py`
- [Skeleton graph](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/stgcn_graph.py): `stgcn_graph.py`
- [TCN attention model](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/tchm_model.py): `tchm_model.py`

### Inference

- [Video and camera inference](https://github.com/mehmet-sarikaya/skeleton-based-basketball-action-recognition/blob/space_jam/ModelTester.py): `ModelTester.py`
- **Gesture labels**

### Other components

- **Operator**

## Connections

- Operator → App menu: chooses mode (evidence: `README.md`)
- App menu → Dataset extraction: starts extraction (evidence: `BasketballGestureRecognitionApp.py`)
- Dataset extraction → Video sampling: samples video (evidence: `KeypointDatasetCreator.py`)
- Dataset extraction → YOLO pose: extracts poses (evidence: `KeypointDatasetCreator.py`)
- App menu → Window preparation: loads dataset (evidence: `BasketballGestureRecognitionApp.py`)
- Window preparation → Skeleton augmentation: augments windows (evidence: `KeypointDatasetProcessor.py`)
- Window preparation → Skeleton visualization: visualizes windows (evidence: `KeypointDatasetProcessor.py`)
- App menu → Training and validation: starts training (evidence: `README.md`)
- Training and validation → Window preparation: uses prepared data (evidence: `ModelTrainer.py`)
- Training and validation → Model selection: requests model (evidence: `ModelTrainer.py`)
- App menu → Model selection: selects architecture (evidence: `BasketballGestureRecognitionApp.py`)
- Model selection → ST-GCN layers: builds ST-GCN (evidence: `ModelCreator.py`)
- Model selection → ST-GCN classifier: selects classifier (evidence: `ModelCreator.py`)
- ST-GCN classifier → Skeleton graph: constructs graph (evidence: `stgcn_model.py`)
- Model selection → TCN attention model: builds TCN model (evidence: `ModelCreator.py`)
- App menu → Video and camera inference: starts inference (evidence: `README.md`)
- Video and camera inference → Video sampling: processes frames (evidence: `ModelTester.py`)
- Video and camera inference → YOLO pose: tracks poses (evidence: `ModelTester.py`)
- Video and camera inference → Gesture labels: displays classifications (evidence: `ModelTester.py`)
