# riship21/gait-recognition-project architecture

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

- Interactive diagram: https://gitdiagram.com/riship21/gait-recognition-project
- Repository: https://github.com/riship21/gait-recognition-project

## Overview

This is a research baseline for closed-set gait identification: CASIA-B silhouette sequences are preprocessed into Gait Energy Images (GEIs), flattened into features, matched against an enrolled gallery, and evaluated by Rank-1 accuracy. Separate scripts audit sequence quality, compare matchers, and visualize same- and different-subject GEIs or distances. The graph focuses on these documented runtime workflows; the dataset itself is external, and no source-backed runtime database or service is present.

Main entry points: [`src/gei.py`](https://github.com/riship21/gait-recognition-project/blob/main/src/gei.py) (GEI generation), [`src/baseline_identification.py`](https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py) (Baseline identification), [`src/compare_matchers.py`](https://github.com/riship21/gait-recognition-project/blob/main/src/compare_matchers.py) (Matcher comparison), [`src/audit_dataset.py`](https://github.com/riship21/gait-recognition-project/blob/main/src/audit_dataset.py) (Dataset quality audit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_representation["Representation"]
  node_preprocess["Silhouette preprocessing<br/>[preprocess.py]"]
  node_gei["GEI generation<br/>[gei.py]"]
end

subgraph group_recognition["Recognition"]
  node_baseline["Baseline identification"]
  node_gallery["Gallery features"]
  node_matcher["Nearest-neighbor matching"]
  node_evaluation["Rank-1 evaluation"]
  node_predictions["Baseline predictions"]
end

subgraph group_analysis["Analysis"]
  node_matcher_compare["Matcher comparison"]
  node_matcher_results["Matcher results"]
  node_audit["Dataset quality audit<br/>[audit_dataset.py]"]
  node_frame_counts["Frame-count table"]
  node_distance_compare["GEI distance comparison"]
  node_same_subject["Same-subject GEIs"]
  node_different_subject["Different-subject GEIs"]
end

node_casia[("CASIA-B silhouettes")]

node_casia -->|"reads frames"| node_gei
node_gei -->|"preprocesses frames"| node_preprocess
node_baseline -->|"generates GEIs"| node_gei
node_baseline -->|"builds gallery"| node_gallery
node_gallery -->|"generates GEIs"| node_gei
node_baseline -->|"matches probes"| node_matcher
node_matcher -->|"compares features"| node_gallery
node_baseline -->|"evaluates predictions"| node_evaluation
node_evaluation -->|"writes results"| node_predictions
node_matcher_compare -->|"builds gallery"| node_gallery
node_matcher_compare -->|"generates probe GEIs"| node_gei
node_matcher_compare -->|"writes results"| node_matcher_results
node_audit -->|"counts frames"| node_casia
node_audit -->|"writes counts"| node_frame_counts
node_distance_compare -->|"generates GEIs"| node_gei
node_same_subject -->|"generates GEIs"| node_gei
node_different_subject -->|"generates GEIs"| node_gei

click node_preprocess "https://github.com/riship21/gait-recognition-project/blob/main/src/preprocess.py"
click node_gei "https://github.com/riship21/gait-recognition-project/blob/main/src/gei.py"
click node_baseline "https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py"
click node_gallery "https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py"
click node_matcher "https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py"
click node_evaluation "https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py"
click node_predictions "https://github.com/riship21/gait-recognition-project/blob/main/results/tables/baseline_predictions.csv"
click node_matcher_compare "https://github.com/riship21/gait-recognition-project/blob/main/src/compare_matchers.py"
click node_matcher_results "https://github.com/riship21/gait-recognition-project/blob/main/results/tables/matcher_comparison.csv"
click node_audit "https://github.com/riship21/gait-recognition-project/blob/main/src/audit_dataset.py"
click node_frame_counts "https://github.com/riship21/gait-recognition-project/blob/main/results/tables/frame_counts_090.csv"
click node_distance_compare "https://github.com/riship21/gait-recognition-project/blob/main/src/compare_distances.py"
click node_same_subject "https://github.com/riship21/gait-recognition-project/blob/main/src/compare_same_subject.py"
click node_different_subject "https://github.com/riship21/gait-recognition-project/blob/main/src/compare_different_subjects.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_preprocess,node_gei toneBlue
class node_baseline,node_gallery,node_matcher,node_evaluation,node_predictions,node_casia toneAmber
class node_matcher_compare,node_matcher_results,node_audit,node_frame_counts,node_distance_compare,node_same_subject,node_different_subject toneMint
```

## Components

### Representation

- [Silhouette preprocessing](https://github.com/riship21/gait-recognition-project/blob/main/src/preprocess.py): `src/preprocess.py`
- [GEI generation](https://github.com/riship21/gait-recognition-project/blob/main/src/gei.py): `src/gei.py`

### Recognition

- [Baseline identification](https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py): `src/baseline_identification.py`
- [Gallery features](https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py): `src/baseline_identification.py`
- [Nearest-neighbor matching](https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py): `src/baseline_identification.py`
- [Rank-1 evaluation](https://github.com/riship21/gait-recognition-project/blob/main/src/baseline_identification.py): `src/baseline_identification.py`
- [Baseline predictions](https://github.com/riship21/gait-recognition-project/blob/main/results/tables/baseline_predictions.csv): `results/tables/baseline_predictions.csv`

### Analysis

- [Matcher comparison](https://github.com/riship21/gait-recognition-project/blob/main/src/compare_matchers.py): `src/compare_matchers.py`
- [Matcher results](https://github.com/riship21/gait-recognition-project/blob/main/results/tables/matcher_comparison.csv): `results/tables/matcher_comparison.csv`
- [Dataset quality audit](https://github.com/riship21/gait-recognition-project/blob/main/src/audit_dataset.py): `src/audit_dataset.py`
- [Frame-count table](https://github.com/riship21/gait-recognition-project/blob/main/results/tables/frame_counts_090.csv): `results/tables/frame_counts_090.csv`
- [GEI distance comparison](https://github.com/riship21/gait-recognition-project/blob/main/src/compare_distances.py): `src/compare_distances.py`
- [Same-subject GEIs](https://github.com/riship21/gait-recognition-project/blob/main/src/compare_same_subject.py): `src/compare_same_subject.py`
- [Different-subject GEIs](https://github.com/riship21/gait-recognition-project/blob/main/src/compare_different_subjects.py): `src/compare_different_subjects.py`

### Other components

- **CASIA-B silhouettes**

## Connections

- CASIA-B silhouettes → GEI generation: reads frames
- GEI generation → Silhouette preprocessing: preprocesses frames
- Baseline identification → GEI generation: generates GEIs
- Baseline identification → Gallery features: builds gallery
- Gallery features → GEI generation: generates GEIs
- Baseline identification → Nearest-neighbor matching: matches probes
- Nearest-neighbor matching → Gallery features: compares features
- Baseline identification → Rank-1 evaluation: evaluates predictions
- Rank-1 evaluation → Baseline predictions: writes results
- Matcher comparison → Gallery features: builds gallery
- Matcher comparison → GEI generation: generates probe GEIs
- Matcher comparison → Matcher results: writes results
- Dataset quality audit → CASIA-B silhouettes: counts frames
- Dataset quality audit → Frame-count table: writes counts
- GEI distance comparison → GEI generation: generates GEIs
- Same-subject GEIs → GEI generation: generates GEIs
- Different-subject GEIs → GEI generation: generates GEIs
