# najnin26/hand-gesture-recognition architecture

> Architecture diagram of the GitHub repository najnin26/hand-gesture-recognition, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/najnin26/hand-gesture-recognition
- Repository: https://github.com/najnin26/hand-gesture-recognition

## Overview

##### Project’s Core Type and Purpose
- This is a computer vision and machine learning project focused on real-time hand gesture (and sign language) recognition.
- It uses live video capture to detect, process, and classify hand gestures using OpenCV for image processing and a TensorFlow/Keras-based machine learning model (stored under the mp_hand_gesture folder).

##### File Structure
- Data Files & Assets:
- DIP-Hand Gesture_compressed.pdf (likely a design or background document)
- data.pickle (may store preprocessed features or training data)
- gesture.names (list of gesture labels available in the system)
- Source Code:
- datacollection.py – responsible for gathering or processing raw data (e.g., capturing hand gesture images).
- test.py – could be used for running tests or demonstrations.
- Model Files:
- The mp_hand_gesture directory includes a TensorFlow/Keras saved model, including keras_metadata.pb, saved_model.pb, and variables directory for model weights.
- Other Files:
- README.md provides an overview of the system’s functionality, input requirements, and the gesture names.
- The presence of a “new” directory (or file) suggests there may be an iterative or experimental component.

##### System’s High-Level Architecture Components
a. Input/Acquisition Component:
- Video Capture: Utilization of a webcam feed (or similar source) via OpenCV.
- Data Acquisition Script (datacollection.py): Responsible for capturing and possibly preprocessing raw hand gesture frames.
b. Preprocessing & Feature Extraction:
- Hand Detection: Process frames to isolate the hand region (could incorporate MediaPipe or OpenCV functionality).
- Feature Extraction: Identify key features (e.g., contours, finger positions) from the detected hand.
c. Gesture Classification Module:
- Machine Learning Model: The TensorFlow/Keras model stored in mp_hand_gesture is responsible for classifying the processed frames into one of the predefined gestures.
- Gesture Labels: Reference the gesture.names file that contains the list of gestures (e.g., "okay", "peace", etc.).
d. Output Component:
- Gesture Output: Final recognized gesture can be displayed on-screen and used to trigger corresponding actions or feedback.
e. (Optional) Data & Training Storage:
- Data Files: data.pickle may be used to store collected training data or intermediate processing results.
- Documentation/Reference Materials: DIP-Hand Gesture_compressed.pdf for design insights.

##### Relationships and Data Flow
- The video capture provides real-time frames to the input component.
- Frames are passed to the preprocessing module, where hand detection and feature extraction occur.
- The processed data is then forwarded to the gesture classification module (the TensorFlow model in mp_hand_gesture).
- Recognized gestures (output) are then displayed or sent to any interfacing components (possibly integrated in test.py or other parts of the application).

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Video Feed (OpenCV)"]:::input
    B["Data Acquisition & Preprocessing (datacollection.py)"]:::process
    C["Gesture Classification (TensorFlow/Keras Model)"]:::ml
    D["Gesture Labels (gesture.names)"]:::support
    E["Data Storage (data.pickle)"]:::support
    F["Output Display (test.py)"]:::output
    G["Documentation (DIP-Hand Gesture_compressed.pdf)"]:::documentation
    H["Overview (README.md)"]:::documentation

    A -->|"provides_frames"| B
    B -->|"processes_data"| C
    B -->|"stores_data"| E
    D -->|"provides_labels"| C
    C -->|"sends_output"| F
    G -.->|"reference"| B
    H -.->|"overview"| B

    click B "https://github.com/najnin26/hand-gesture-recognition/blob/main/datacollection.py"
    click C "https://github.com/najnin26/hand-gesture-recognition/tree/main/mp_hand_gesture"
    click D "https://github.com/najnin26/hand-gesture-recognition/blob/main/gesture.names"
    click E "https://github.com/najnin26/hand-gesture-recognition/blob/main/data.pickle"
    click F "https://github.com/najnin26/hand-gesture-recognition/blob/main/test.py"
    click G "https://github.com/najnin26/hand-gesture-recognition/blob/main/DIP-Hand Gesture_compressed.pdf"
    click H "https://github.com/najnin26/hand-gesture-recognition/blob/main/README.md"

    classDef input fill:#9cf,stroke:#333,stroke-width:2px;
    classDef process fill:#ccf,stroke:#333,stroke-width:2px;
    classDef ml fill:#cfc,stroke:#333,stroke-width:2px;
    classDef output fill:#fc9,stroke:#333,stroke-width:2px;
    classDef support fill:#ffc,stroke:#333,stroke-width:2px;
    classDef documentation fill:#f9c,stroke:#333,stroke-width:2px;
```
