# kartikgill/easter2 architecture

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

- Interactive diagram: https://gitdiagram.com/kartikgill/easter2
- Repository: https://github.com/kartikgill/easter2

## Overview

##### Project type and purpose
- Easter2.0 is a research‐oriented machine‐learning codebase implementing a convolutional architecture for handwritten text recognition (HTR). It provides data‐loading, model training, evaluation, and inference scripts, along with sample Jupyter notebooks.

##### File structure
- Top‐level directories:
- data/            ─ raw and preprocessed datasets (e.g., IAM)
- logs/            ─ training/evaluation log outputs
- notebooks/       ─ exploratory & tutorial notebooks (data download, training, testing)
- src/             ─ core code: configuration, data loader, model definition, training, and prediction
- weights/         ─ pre‐trained model checkpoints
- Key files in src/:
- config.py        ─ paths, hyperparameters, dataset settings
- data_loader.py   ─ data ingestion and augmentation (TACo)
- easter_model.py  ─ model architecture (1D conv, residual connections, SE module) and train() entry point
- predict.py       ─ batch prediction for full lines/images
- predict_line.py  ─ single‐line inference CLI
- Supporting files:
- requirements.txt ─ Python dependencies (Keras/TensorFlow, numpy, etc.)
- notebooks/*.ipynb ─ examples of dataset download, training loops, evaluation metrics

##### README for additional insights
- Confirms the focus on 1D convolutional HTR, dense residual blocks, SE module, and TACo data augmentation.
- Explains setup steps: download weights, configure data paths, install dependencies, run train() or predict_line.py.

##### Details
- That Data Loader incorporates TACo augmentation
- That config.py governs all paths & hyperparameters
- Explicit separation of training vs. inference workflows

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        DataStorage["Data Storage\ndata/ (IAM dataset)"]:::data
    end

    %% Preprocessing
    subgraph "Preprocessing & Augmentation"
        DataLoader["Data Loader & Preprocessor\nsrc/data_loader.py\n(TACo augmentations)"]:::pre
    end

    %% Core Model & Training
    subgraph "Core Model & Training"
        Config["Configuration\nsrc/config.py"]:::config
        Model["Model Definition\nsrc/easter_model.py\n(1D conv, Residual + SE)"]:::model
        Trainer["Training Engine\ntrain() entry in easter_model.py"]:::train
        Logs["Logging Outputs\nlogs/"]:::storage
        Weights["Checkpoint Storage\nweights/"]:::storage
    end

    %% Inference Branch
    subgraph "Inference Branch"
        BatchInfer["Batch Inference\nsrc/predict.py"]:::infer
        LineInfer["Single-Line Inference\nsrc/predict_line.py"]:::infer
    end

    %% Notebooks & Documentation
    subgraph "Notebooks & Documentation"
        Notebooks["Notebooks\nnotebooks/"]:::notebook
        Requirements["Dependencies\nrequirements.txt"]:::docs
        Readme["Project Overview & Instructions\nREADME.md"]:::docs
    end

    %% Connections
    DataStorage -->|"raw data"| DataLoader
    DataLoader -->|"augmented batches"| Trainer
    Config -->|"hyperparams & paths"| Trainer
    Model -->|"model structure"| Trainer
    Trainer -->|"writes logs"| Logs
    Trainer -->|"saves .hdf5 checkpoint"| Weights

    Config -->|"load config"| BatchInfer
    Weights -->|"load checkpoint"| BatchInfer
    BatchInfer -->|"predicted text"| BatchInfer

    Config -->|"load config"| LineInfer
    Weights -->|"load checkpoint"| LineInfer
    LineInfer -->|"predicted text"| LineInfer

    Notebooks --> DataLoader
    Notebooks --> Trainer
    Notebooks --> BatchInfer
    Notebooks --> LineInfer

    %% Click Events
    click DataStorage "https://github.com/kartikgill/easter2/tree/main/data/"
    click DataLoader "https://github.com/kartikgill/easter2/blob/main/src/data_loader.py"
    click Model "https://github.com/kartikgill/easter2/blob/main/src/easter_model.py"
    click Trainer "https://github.com/kartikgill/easter2/blob/main/src/easter_model.py"
    click Config "https://github.com/kartikgill/easter2/blob/main/src/config.py"
    click BatchInfer "https://github.com/kartikgill/easter2/blob/main/src/predict.py"
    click LineInfer "https://github.com/kartikgill/easter2/blob/main/src/predict_line.py"
    click Logs "https://github.com/kartikgill/easter2/tree/main/logs/"
    click Weights "https://github.com/kartikgill/easter2/tree/main/weights/"
    click Notebooks "https://github.com/kartikgill/easter2/tree/main/notebooks/"
    click Requirements "https://github.com/kartikgill/easter2/blob/main/requirements.txt"
    click Readme "https://github.com/kartikgill/easter2/blob/main/README.md"

    %% Styles
    classDef data fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef pre fill:#98FB98,stroke:#000,stroke-width:1px
    classDef model fill:#FFA500,stroke:#000,stroke-width:1px
    classDef train fill:#FFA500,stroke:#000,stroke-width:1px
    classDef infer fill:#DDA0DD,stroke:#000,stroke-width:1px
    classDef storage fill:#87CEEB,stroke:#000,stroke-width:1px
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef notebook fill:#AFEEEE,stroke:#000,stroke-width:1px
    classDef docs fill:#F5F5F5,stroke:#000,stroke-width:1px
```
