# leminhhaii/asl_classification_project architecture

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

- Interactive diagram: https://gitdiagram.com/leminhhaii/asl_classification_project
- Repository: https://github.com/leminhhaii/asl_classification_project

## Overview

##### Project type and purpose
- This is an end-to-end machine-learning pipeline for American Sign Language recognition.
- It provides utilities to collect or import a dataset, train a convolutional neural network (FCNN) via Jupyter notebooks, and run inference in real time on video or on static images using pre-trained model weights.

##### File structure
- Top-level folders:
- create dataset – scripts for capturing images and assembling the training dataset
- training – Jupyter notebooks for model development and training
- model using – Python scripts for inference (video & picture)
- example output – sample output video with predictions
- Configuration/build: requirements.txt defines dependencies; .vscode contains editor settings; .gitattributes for repo config.
- No web front end or database; purely a data-science pipeline and inference application.

##### README for additional insights
- Describes how to download a pre-trained model and dataset from Google Drive.
- Instructs how to run inference scripts from the project root.
- Mentions no server or UI beyond console/terminal output and optional saved media.

##### Main components and interactions
a. Data Layer
- Data Capture: create dataset/collect_imgs.py
- Dataset Assembly: create dataset/create_dataset.py
- External Storage: Downloaded dataset (dataset folder)
b. Training Layer
- Jupyter Notebooks (training/*.ipynb)
- ML Framework (TensorFlow or PyTorch; see requirements.txt)
- Output: Serialized model weights (saved to model folder)
c. Model Storage
- Local “model” directory containing .h5/.pth files
- External Model Source: Google Drive link for downloading pre-trained model
d. Inference Layer
- Video Inference: model using/model_use_video_camera.py
- Image Inference: model using/model_use_picture.py
- Input Sources: Webcam or image file paths
- Output: On-screen labels and saved video/image predictions (example output)
e. Dependencies & Environment
- requirements.txt (OpenCV, NumPy, ML libraries, etc.)
- Python interpreter, optional virtual environment

##### Architectural patterns and design principles
- Clear separation of concerns:
1) Data ingestion & preprocessing
2) Model development & training
3) Model storage & versioning
4) Inference application
- Pipeline pattern (ETL → Train → Deploy → Inference)
- Reproducibility: notebooks document experiments, requirements.txt fixes dependencies

##### Final recommendations
- Readability: consistent font, spacing, and alignment.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Layer
    subgraph "Data Layer"
        DC["collect_imgs.py"]:::data
        DA["create_dataset.py"]:::data
        DS[(Dataset Folder)]:::storage
        DC -->|"images"| DS
        DA -->|"assembled dataset"| DS
    end

    %% Training Layer
    subgraph "Training Layer"
        MN["ML_trainer.ipynb"]:::train
        FC["asl-training-fcnn.ipynb"]:::train
        MLFW((ML Framework)):::compute
        MN -->|"tensors"| MLFW
        FC -->|"tensors"| MLFW
        MLFW -->|"model weights"| MS[(Model Directory)]:::storage
    end

    %% Model Storage
    subgraph "Model Storage"
        GD(("Google Drive")):::external
        MS
        GD -->|"download pretrained"| MS
    end

    %% Inference Layer
    subgraph "Inference Layer"
        VI["model_use_video_camera.py"]:::inference
        II["model_use_picture.py"]:::inference
        OUT1["Live Video Output"]:::output
        OUT2["Image Output"]:::output
        MS -->|"load weights"| VI
        MS -->|"load weights"| II
        VI -->|"predictions"| OUT1
        II -->|"predictions"| OUT2
    end

    %% Project Configuration
    subgraph "Project Configuration"
        RE["requirements.txt"]:::config
        RD["readme.md"]:::config
        VS[".vscode/"]:::config
        GA[".gitattributes"]:::config
    end

    %% Click Events
    click DC "https://github.com/leminhhaii/asl_classification_project/blob/main/create dataset/collect_imgs.py"
    click DA "https://github.com/leminhhaii/asl_classification_project/blob/main/create dataset/create_dataset.py"
    click MN "https://github.com/leminhhaii/asl_classification_project/blob/main/training/ML_trainer.ipynb"
    click FC "https://github.com/leminhhaii/asl_classification_project/blob/main/training/asl-training-fcnn.ipynb"
    click VI "https://github.com/leminhhaii/asl_classification_project/blob/main/model using/model_use_video_camera.py"
    click II "https://github.com/leminhhaii/asl_classification_project/blob/main/model using/model_use_picture.py"
    click OUT1 "https://github.com/leminhhaii/asl_classification_project/blob/main/example output/output_with_predictions.mp4"
    click RE "https://github.com/leminhhaii/asl_classification_project/blob/main/requirements.txt"
    click RD "https://github.com/leminhhaii/asl_classification_project/blob/main/readme.md"
    click VS "https://github.com/leminhhaii/asl_classification_project/tree/main/.vscode/"
    click GA "https://github.com/leminhhaii/asl_classification_project/blob/main/.gitattributes"

    %% Styles
    classDef data fill:#ADD8E6,stroke:#333;
    classDef train fill:#98FB98,stroke:#333;
    classDef compute fill:#90EE90,stroke:#333;
    classDef storage fill:#fff2b2,stroke:#333;
    classDef external fill:#E0FFFF,stroke:#333,stroke-dasharray: 5 5;
    classDef inference fill:#FFA500,stroke:#333;
    classDef output fill:#FFD700,stroke:#333;
    classDef config fill:#D3D3D3,stroke:#333;
```
