# adityakamat24/sign-language-detection architecture

> Architecture diagram of the GitHub repository adityakamat24/sign-language-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adityakamat24/sign-language-detection
- Repository: https://github.com/adityakamat24/sign-language-detection

## Overview

##### Main Components
- Data Capture Module: Represented by the "Capture dataset.ipynb", this component handles image collection using a webcam.
- Data Preprocessing & Dataset Creation: Although not a separate file, preprocessing steps (resizing, grayscaling, normalizing) are part of the dataset preparation workflow.
- Training Module: "Training.ipynb" captures the neural network training phase using the preprocessed dataset. The trained model artifacts include "model-bw.h5" (weights) and "model-bw.json" (model architecture).
- Real-time Application Module: "application.ipynb" ties together real-time image capture, preprocessing, and inference using the pre-trained model. This component also incorporates the Tkinter GUI to interface with the user.
- Utility Component: "make folders.ipynb" could be included as a helper for setting up the expected directory structure (for saving datasets, models, etc.).

##### Relationships and Data Flow
- The flow begins with the Data Capture Module where images are taken from the webcam.
- The captured images then pass through the Data Preprocessing & Dataset Creation stage, where they are transformed (resized, converted to grayscale, normalized).
- The preprocessed dataset is used in the Training Module to build a neural network model (using TensorFlow), with output stored as model files.
- Finally, the Real-time Application performs continuous image acquisition through the webcam, processes each frame (using OpenCV), and applies the trained model to recognize signs. Results are displayed in the Tkinter-based GUI.

##### Architectural Patterns & Technologies
- The project follows a pipeline-based pattern where data flows sequentially through capture, processing, training, and inference stages.
- Key technologies: Python for scripting, OpenCV for computer vision, TensorFlow for deep learning, and Tkinter for the GUI.
- Separation of concerns: each notebook represents a distinct stage of the workflow ensuring modularity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Setup Stage"
        utility["Utility (Folder Setup)"]:::utility
    end

    subgraph "Capture Stage"
        capture["Data Capture (OpenCV)"]:::capture
    end

    subgraph "Preprocessing Stage"
        preprocess["Data Preprocessing/Preparation"]:::preprocess
    end

    subgraph "Training Module"
        trainingNotebook["Training Notebook (TensorFlow)"]:::training
        modelWeights["Model Weights (model-bw.h5)"]:::training
        modelArchitecture["Model Architecture (model-bw.json)"]:::training
    end

    subgraph "Inference Stage"
        inference["Real-time Inference & GUI (Tkinter & OpenCV)"]:::inference
    end

    %% Data Flow
    utility -->|"sets up folders"| capture
    capture -->|"captures images"| preprocess
    preprocess -->|"provides dataset"| trainingNotebook
    trainingNotebook -->|"produces model"| modelWeights
    trainingNotebook -->|"produces model"| modelArchitecture
    modelWeights -->|"supplies trained weights"| inference
    modelArchitecture -->|"supplies model structure"| inference
    inference -->|"feedback loop"| capture

    %% Click Events
    click utility "https://github.com/adityakamat24/sign-language-detection/blob/main/make folders.ipynb"
    click capture "https://github.com/adityakamat24/sign-language-detection/blob/main/Capture dataset.ipynb"
    click trainingNotebook "https://github.com/adityakamat24/sign-language-detection/blob/main/Training.ipynb"
    click modelWeights "https://github.com/adityakamat24/sign-language-detection/blob/main/model-bw.h5"
    click modelArchitecture "https://github.com/adityakamat24/sign-language-detection/blob/main/model-bw.json"
    click inference "https://github.com/adityakamat24/sign-language-detection/blob/main/application.ipynb"

    %% Styles
    classDef utility fill:#D2B4DE,stroke:#5D6D7E,stroke-width:2px;
    classDef capture fill:#AED6F1,stroke:#2874A6,stroke-width:2px;
    classDef preprocess fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef training fill:#A9DFBF,stroke:#1E8449,stroke-width:2px;
    classDef inference fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
```
