# ahmetgunduz/real-time-gesrec architecture

> Architecture diagram of the GitHub repository ahmetgunduz/real-time-gesrec, 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/ahmetgunduz/real-time-gesrec
- Repository: https://github.com/ahmetgunduz/real-time-gesrec

## Overview

This is a PyTorch research application for offline and real-time dynamic hand-gesture recognition. The principal workflow samples video frames, applies spatial and temporal transforms, and feeds 3D CNNs to classify gestures; online evaluation adds sliding-window detection and one-time gesture activation. Training and validation provide an offline model-development workflow. The graph includes dataset preparation and documented evaluation capabilities; several subsystem links rely on the README or SOURCE INDEX because their implementation was not excerpted.

Main entry points: [`main.py`](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/main.py) (Training entry point), [`dataset.py`](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/dataset.py) (Dataset selection), [`online_test_video.py`](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/online_test_video.py) (Online video test), [`model.py`](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/model.py) (Model factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Video data"]
  node_prep["Dataset preparation<br/>[ego_prepare.py]"]
  node_annotations["Gesture annotations<br/>[egogesture_json.py]"]
  node_dataset_router["Dataset selection<br/>[dataset.py]"]
  node_egogesture["EgoGesture clips<br/>[egogesture.py]"]
  node_egogesture_online["EgoGesture windows"]
  node_nv["NVGesture clips<br/>[nv.py]"]
  node_nv_online["NVGesture windows<br/>[nv_online.py]"]
  node_other_datasets["Other datasets"]
end

subgraph group_runtime["Recognition runtime"]
  node_transforms["Clip transforms"]
  node_temporal["Temporal sampling"]
  node_target["Class targets"]
  node_offline["Offline inference<br/>[inference.py]"]
  node_online_video["Online video test"]
  node_online_stream["Online clip test"]
  node_runtime_utils["Detection metrics<br/>[utils.py]"]
end

subgraph group_models["3D CNN models"]
  node_model_factory["Model factory<br/>[model.py]"]
  node_resnet["3D ResNet<br/>[resnet.py]"]
  node_shufflenet["ShuffleNetV2<br/>[shufflenetv2.py]"]
  node_other_models["CNN architectures"]
end

subgraph group_learning["Training and evaluation"]
  node_options["Run configuration<br/>[opts.py]"]
  node_training["Model training<br/>[train.py]"]
  node_validation["Validation<br/>[validation.py]"]
  node_train_entry["Training entry point<br/>[main.py]"]
  node_eval_tools["Dataset evaluation<br/>[eval_kinetics.py]"]
end

node_user(("Researcher"))
node_videos[("Video datasets")]

node_user -->|"configures training"| node_train_entry
node_user -->|"runs online test"| node_online_video
node_videos -->|"provides source data"| node_prep
node_prep -->|"prepares frame lists"| node_annotations
node_annotations -.->|"supplies annotations"| node_dataset_router
node_train_entry -->|"parses options"| node_options
node_train_entry -->|"builds datasets"| node_dataset_router
node_dataset_router -->|"selects dataset"| node_egogesture
node_dataset_router -->|"selects dataset"| node_nv
node_dataset_router -->|"selects online data"| node_egogesture_online
node_dataset_router -->|"selects online data"| node_nv_online
node_dataset_router -->|"selects dataset"| node_other_datasets
node_egogesture -->|"uses spatial transforms"| node_transforms
node_egogesture_online -->|"uses spatial transforms"| node_transforms
node_egogesture_online -->|"uses temporal sampling"| node_temporal
node_nv -->|"uses spatial transforms"| node_transforms
node_nv_online -->|"uses spatial transforms"| node_transforms
node_nv_online -->|"uses temporal sampling"| node_temporal
node_train_entry -->|"configures transforms"| node_transforms
node_train_entry -->|"samples training clips"| node_temporal
node_train_entry -->|"creates class targets"| node_target
node_train_entry -->|"creates model"| node_model_factory
node_model_factory -->|"constructs architecture"| node_resnet
node_model_factory -->|"constructs architecture"| node_shufflenet
node_model_factory -->|"constructs architecture"| node_other_models
node_train_entry -->|"runs epochs"| node_training
node_train_entry -->|"validates model"| node_validation
node_online_video -->|"parses options"| node_options
node_online_video -->|"loads classifier"| node_model_factory
node_online_video -->|"uses detection metrics"| node_runtime_utils
node_online_stream -->|"loads classifier"| node_model_factory
node_online_video -.->|"reads gesture windows"| node_egogesture_online
node_online_video -.->|"reads gesture windows"| node_nv_online
node_online_stream -.->|"reads gesture windows"| node_egogesture_online
node_eval_tools -.->|"evaluates dataset"| node_videos

click node_prep "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/utils/ego_prepare.py"
click node_annotations "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/utils/egogesture_json.py"
click node_dataset_router "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/dataset.py"
click node_egogesture "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/datasets/egogesture.py"
click node_egogesture_online "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/datasets/egogesture_online.py"
click node_nv "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/datasets/nv.py"
click node_nv_online "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/datasets/nv_online.py"
click node_other_datasets "https://github.com/ahmetgunduz/real-time-gesrec/tree/master/datasets"
click node_transforms "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/spatial_transforms.py"
click node_temporal "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/temporal_transforms.py"
click node_target "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/target_transforms.py"
click node_offline "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/inference.py"
click node_online_video "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/online_test_video.py"
click node_online_stream "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/online_test_wo_detector.py"
click node_runtime_utils "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/utils.py"
click node_model_factory "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/model.py"
click node_resnet "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/models/resnet.py"
click node_shufflenet "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/models/shufflenetv2.py"
click node_other_models "https://github.com/ahmetgunduz/real-time-gesrec/tree/master/models"
click node_options "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/opts.py"
click node_training "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/train.py"
click node_validation "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/validation.py"
click node_train_entry "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/main.py"
click node_eval_tools "https://github.com/ahmetgunduz/real-time-gesrec/blob/master/utils/eval_kinetics.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_prep,node_annotations,node_dataset_router,node_egogesture,node_egogesture_online,node_nv,node_nv_online,node_other_datasets toneBlue
class node_transforms,node_temporal,node_target,node_offline,node_online_video,node_online_stream,node_runtime_utils,node_videos toneAmber
class node_model_factory,node_resnet,node_shufflenet,node_other_models toneMint
class node_options,node_training,node_validation,node_train_entry,node_eval_tools toneRose
class node_user toneIndigo
```

## Components

### Video data

- [Dataset preparation](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/utils/ego_prepare.py): `utils/ego_prepare.py`
- [Gesture annotations](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/utils/egogesture_json.py): `utils/egogesture_json.py`
- [Dataset selection](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/dataset.py): `dataset.py`
- [EgoGesture clips](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/datasets/egogesture.py): `datasets/egogesture.py`
- [EgoGesture windows](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/datasets/egogesture_online.py): `datasets/egogesture_online.py`
- [NVGesture clips](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/datasets/nv.py): `datasets/nv.py`
- [NVGesture windows](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/datasets/nv_online.py): `datasets/nv_online.py`
- [Other datasets](https://github.com/ahmetgunduz/real-time-gesrec/tree/master/datasets): `datasets`

### Recognition runtime

- [Clip transforms](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/spatial_transforms.py): `spatial_transforms.py`
- [Temporal sampling](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/temporal_transforms.py): `temporal_transforms.py`
- [Class targets](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/target_transforms.py): `target_transforms.py`
- [Offline inference](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/inference.py): `inference.py`
- [Online video test](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/online_test_video.py): `online_test_video.py`
- [Online clip test](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/online_test_wo_detector.py): `online_test_wo_detector.py`
- [Detection metrics](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/utils.py): `utils.py`

### 3D CNN models

- [Model factory](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/model.py): `model.py`
- [3D ResNet](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/models/resnet.py): `models/resnet.py`
- [ShuffleNetV2](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/models/shufflenetv2.py): `models/shufflenetv2.py`
- [CNN architectures](https://github.com/ahmetgunduz/real-time-gesrec/tree/master/models): `models`

### Training and evaluation

- [Run configuration](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/opts.py): `opts.py`
- [Model training](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/train.py): `train.py`
- [Validation](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/validation.py): `validation.py`
- [Training entry point](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/main.py): `main.py`
- [Dataset evaluation](https://github.com/ahmetgunduz/real-time-gesrec/blob/master/utils/eval_kinetics.py): `utils/eval_kinetics.py`

### Other components

- **Researcher**
- **Video datasets**

## Connections

- Researcher → Training entry point: configures training
- Researcher → Online video test: runs online test
- Video datasets → Dataset preparation: provides source data
- Dataset preparation → Gesture annotations: prepares frame lists
- Gesture annotations → Dataset selection: supplies annotations
- Training entry point → Run configuration: parses options (evidence: `main.py`)
- Training entry point → Dataset selection: builds datasets (evidence: `main.py`)
- Dataset selection → EgoGesture clips: selects dataset (evidence: `dataset.py`)
- Dataset selection → NVGesture clips: selects dataset (evidence: `dataset.py`)
- Dataset selection → EgoGesture windows: selects online data (evidence: `dataset.py`)
- Dataset selection → NVGesture windows: selects online data (evidence: `dataset.py`)
- Dataset selection → Other datasets: selects dataset (evidence: `dataset.py`)
- EgoGesture clips → Clip transforms: uses spatial transforms (evidence: `datasets/egogesture.py`)
- EgoGesture windows → Clip transforms: uses spatial transforms (evidence: `datasets/egogesture_online.py`)
- EgoGesture windows → Temporal sampling: uses temporal sampling (evidence: `datasets/egogesture_online.py`)
- NVGesture clips → Clip transforms: uses spatial transforms (evidence: `datasets/nv.py`)
- NVGesture windows → Clip transforms: uses spatial transforms (evidence: `datasets/nv_online.py`)
- NVGesture windows → Temporal sampling: uses temporal sampling (evidence: `datasets/nv_online.py`)
- Training entry point → Clip transforms: configures transforms (evidence: `main.py`)
- Training entry point → Temporal sampling: samples training clips (evidence: `main.py`)
- Training entry point → Class targets: creates class targets (evidence: `main.py`)
- Training entry point → Model factory: creates model (evidence: `main.py`)
- Model factory → 3D ResNet: constructs architecture (evidence: `model.py`)
- Model factory → ShuffleNetV2: constructs architecture (evidence: `model.py`)
- Model factory → CNN architectures: constructs architecture (evidence: `model.py`)
- Training entry point → Model training: runs epochs (evidence: `main.py`)
- Training entry point → Validation: validates model (evidence: `main.py`)
- Online video test → Run configuration: parses options (evidence: `online_test_video.py`)
- Online video test → Model factory: loads classifier (evidence: `online_test_video.py`)
- Online video test → Detection metrics: uses detection metrics (evidence: `online_test_video.py`)
- Online clip test → Model factory: loads classifier (evidence: `online_test_wo_detector.py`)
- Online video test → EgoGesture windows: reads gesture windows
- Online video test → NVGesture windows: reads gesture windows
- Online clip test → EgoGesture windows: reads gesture windows
- Dataset evaluation → Video datasets: evaluates dataset
