# jcastellanos1/traslate_sign_language architecture

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

- Interactive diagram: https://gitdiagram.com/jcastellanos1/traslate_sign_language
- Repository: https://github.com/jcastellanos1/traslate_sign_language

## Overview

##### Project type and purpose
- This is a small‐scale full-stack web application called “Translate_Sign_Language,” whose goal is to take image input of hand signs (letters or numbers) and return the recognized character(s).
- The README confirms it’s a mini-project sign-language translator.

##### File structure
Top-level files and directories:
- Web.py, main.py: entry points for the Python web server
- modelos/: model code for letters (modelo_letras.py) and numbers (modelo_numeros.py)
- utils_image.py: image pre-processing utilities
- static/: static assets (CSS, JS) for the front end
- templates/: HTML template(s)
- server.crt / server.key: SSL certificate for HTTPS
Observations:
- A single web server (using the Web.py microframework) serves both API endpoints and the HTML pages.
- The front end is a static HTML+JS page that calls back to the Python backend.
- ML models live in the modelos/ directory and are invoked by the backend.

##### README for additional insights
- We infer that the workflow is: user uploads or streams a sign image via the web UI → backend preprocesses → ML model predicts → result flows back to the UI.

##### Final recommendations
- Be explicit about each component’s responsibility.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Browser
    subgraph "Client Browser (UI)"
        direction TB
        index["index.html"]:::frontend
        styles["styles.css"]:::frontend
        script["script.js"]:::frontend
    end

    %% Web Server
    subgraph "Web Server (API & Page Serving)"
        direction TB
        webpy["Web.py"]:::backend
        mainpy["main.py"]:::backend
        cert["server.crt"]:::backend
        key["server.key"]:::backend
    end

    %% Image Processing
    utils["utils_image.py"]:::backend

    %% ML Models
    subgraph "ML Models"
        direction TB
        letters["modelo_letras.py"]:::ml
        numbers["modelo_numeros.py"]:::ml
    end

    %% Data Flow
    script -->|"Image upload (HTTPS)"| webpy
    script -->|"Image upload (HTTPS)"| mainpy
    webpy -->|"calls preprocess()"| utils
    mainpy -->|"calls preprocess()"| utils
    utils -->|"preprocessed tensor"| webpy
    utils -->|"preprocessed tensor"| mainpy
    webpy -->|"infer letter"| letters
    webpy -->|"infer number"| numbers
    mainpy -->|"infer letter"| letters
    mainpy -->|"infer number"| numbers
    letters -->|"letter prediction"| webpy
    letters -->|"letter prediction"| mainpy
    numbers -->|"number prediction"| webpy
    numbers -->|"number prediction"| mainpy
    webpy -->|"JSON prediction"| script
    mainpy -->|"JSON prediction"| script

    %% Click Events
    click index "https://github.com/jcastellanos1/traslate_sign_language/blob/main/templates/index.html"
    click styles "https://github.com/jcastellanos1/traslate_sign_language/blob/main/static/css/styles.css"
    click script "https://github.com/jcastellanos1/traslate_sign_language/blob/main/static/js/script.js"
    click webpy "https://github.com/jcastellanos1/traslate_sign_language/blob/main/Web.py"
    click mainpy "https://github.com/jcastellanos1/traslate_sign_language/blob/main/main.py"
    click cert "https://github.com/jcastellanos1/traslate_sign_language/blob/main/server.crt"
    click key "https://github.com/jcastellanos1/traslate_sign_language/blob/main/server.key"
    click utils "https://github.com/jcastellanos1/traslate_sign_language/blob/main/utils_image.py"
    click letters "https://github.com/jcastellanos1/traslate_sign_language/blob/main/modelos/modelo_letras.py"
    click numbers "https://github.com/jcastellanos1/traslate_sign_language/blob/main/modelos/modelo_numeros.py"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#333,stroke-width:1px
    classDef ml fill:#FFA500,stroke:#333,stroke-width:1px
```
