# rrupeshh/simple-sign-language-detector architecture

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

- Interactive diagram: https://gitdiagram.com/rrupeshh/simple-sign-language-detector
- Repository: https://github.com/rrupeshh/simple-sign-language-detector

## Overview

##### Project type and purpose
- This is a standalone machine-learning pipeline (not a web app) for American Sign Language (ASL) recognition.
- It uses Python scripts and a Convolutional Neural Network (CNN) in Keras/TensorFlow, plus OpenCV for image capture and preprocessing.

##### File structure
- Top-level scripts:
- .py – captures hand images via webcam, writes to mydata/training_set or mydata/test_set
- cnn_model.py – defines and trains the CNN on images in mydata/training_set; saves Trained_model.h5
- test_model.py – loads the trained model, evaluates it against mydata/test_set
- recognise.py – real-time inference: reads webcam frames, segments the hand (via HSV trackbars), predicts ASL letters
- Data directories:
- mydata/training_set/{A…Z} and mydata/test_set/{A…Z} – labeled image folders
- Model artifact:
- Trained_model.h5 – serialized Keras model

##### README for additional insights
- Confirms tools: Python3, OpenCV3, TensorFlow, Keras
- Workflow: capture → train → test → recognise
- No microservices or external APIs—pure local execution

##### Elements
- Clear labels for each module/script and folder

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Dependencies
    subgraph "External Dependencies"
        Python["Python 3"]:::external
        OpenCV["OpenCV"]:::external
        TF["TensorFlow/Keras"]:::external
    end

    Webcam["Webcam"]:::external

    %% Data Storage
    subgraph "Data Storage" 
        TrainingSet["mydata/training_set/"]:::data
        TestSet["mydata/test_set/"]:::data
    end

    %% Pipeline Modules
    subgraph "ML Pipeline"
        Capture["capture.py"]:::script
        CNN["cnn_model.py"]:::script
        TestMod["test_model.py"]:::script
        Recognise["recognise.py"]:::script
        ModelStore["Trained_model.h5"]:::model
    end

    %% Data Flow
    Webcam -->|captures images| Capture
    Capture -->|writes images| TrainingSet
    Capture -->|writes images| TestSet
    TrainingSet -->|reads for training| CNN
    CNN -->|saves model| ModelStore
    TestSet -->|provides test data| TestMod
    ModelStore -->|loads model| TestMod
    ModelStore -->|loads model| Recognise
    Webcam -->|live frames| Recognise

    %% External Dependencies Usage
    Python --> Capture
    Python --> CNN
    Python --> TestMod
    Python --> Recognise
    OpenCV --> Capture
    OpenCV --> Recognise
    TF --> CNN
    TF --> TestMod
    TF --> Recognise

    %% Click Events
    click Capture "https://github.com/rrupeshh/simple-sign-language-detector/blob/master/capture.py"
    click TrainingSet "https://github.com/rrupeshh/simple-sign-language-detector/tree/master/mydata/training_set/"
    click TestSet "https://github.com/rrupeshh/simple-sign-language-detector/tree/master/mydata/test_set/"
    click CNN "https://github.com/rrupeshh/simple-sign-language-detector/blob/master/cnn_model.py"
    click TestMod "https://github.com/rrupeshh/simple-sign-language-detector/blob/master/test_model.py"
    click Recognise "https://github.com/rrupeshh/simple-sign-language-detector/blob/master/recognise.py"
    click ModelStore "https://github.com/rrupeshh/simple-sign-language-detector/blob/master/Trained_model.h5"

    %% Styles
    classDef script fill:#ADD8E6,stroke:#0366d6,color:#000;
    classDef data fill:#90EE90,stroke:#228B22,color:#000;
    classDef model fill:#FFD700,stroke:#DAA520,color:#000;
    classDef external fill:#FFA500,stroke:#FF8C00,color:#000;
```
