# theflashwin/custom-drawing-classifier architecture

> Architecture diagram of the GitHub repository theflashwin/custom-drawing-classifier, 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/theflashwin/custom-drawing-classifier
- Repository: https://github.com/theflashwin/custom-drawing-classifier

## Overview

##### Main Components
- User Interface / Entry Point: Represented by the main.py that starts the application and accepts user input.
- Classifier Engine: The core machine learning/AI component that loads a pre-trained model and performs classification tasks based on input. This includes data processing and decision logic.
- Pre-trained Model & Data Storage: The “test” directory contains files named Circle, Square, Triangle and also a test_data.pickle file that likely holds sample data or model parameters.
- Testing Module: The test.py script (and the “test” subdirectory) indicates additional testing functionalities to validate model predictions.

##### Interactions/Flow
- The application begins with the user running main.py.
- main.py prompts the user for input (i.e., a project name). If “test” is entered, the system loads the corresponding pre-trained model.
- Results are processed and predicted outcomes returned (possibly printed on the console).
- Optionally, test.py can be run to verify and validate the overall functioning and integrity of the classifier.

##### Architectural Patterns and Design Principles
- Separation of Concerns: There is a clear split between the input/interaction logic (main.py), the classification model and supporting data (under test), and unit/integration testing (test.py).
- Modularity: Although the project is relatively small, the independent “test” directory and use of separate scripts highlight a modular design that could be scaled in a more complete application.
- Simple Pipeline Flow: Data flows from input to processing, to classification, and then to output.

##### Relevant Technologies and Tools
- Python: The primary language with its built-in file management and data handling.
- Machine Learning/AI Framework (Implicit): The project likely utilizes popular libraries (even if not explicitly listed, one might expect libraries for image processing or ML inference if extended further).
- Pickle for Data Serialization: test_data.pickle indicates the project uses Python’s pickle module to load pre-trained model data or test data.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    UI["User Interface/CLI"]:::ui

    %% Controller Layer
    MC["Main Controller (main.py)"]:::controller

    %% Processing Layer
    ML["ML/AI Classifier"]:::classifier

    %% Data Layer
    subgraph "Data Store & Model Files"
        TD["Test Data (test_data.pickle)"]:::datastore
        C["Circle"]:::shape
        S["Square"]:::shape
        T["Triangle"]:::shape
    end

    %% Testing Layer
    TS["Testing Suite (test.py)"]:::testing

    %% Flow Connections
    UI -->|"user_command"| MC
    MC -->|"invoke_classification"| ML
    ML -->|"load_model_data"| TD
    ML -->|"load_shape_data"| C
    ML -->|"load_shape_data"| S
    ML -->|"load_shape_data"| T
    MC -->|"run_tests(optional)"| TS
    TS -->|"validate_classification"| ML

    %% Click Events
    click MC "https://github.com/theflashwin/custom-drawing-classifier/blob/main/main.py"
    click TD "https://github.com/theflashwin/custom-drawing-classifier/blob/main/test/test_data.pickle"
    click C "https://github.com/theflashwin/custom-drawing-classifier/tree/main/test/Circle"
    click S "https://github.com/theflashwin/custom-drawing-classifier/tree/main/test/Square"
    click T "https://github.com/theflashwin/custom-drawing-classifier/tree/main/test/Triangle"
    click TS "https://github.com/theflashwin/custom-drawing-classifier/blob/main/test.py"

    %% Styles
    classDef ui fill:#ffddcc,stroke:#333,stroke-width:2px;
    classDef controller fill:#ccddff,stroke:#333,stroke-width:2px;
    classDef classifier fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef datastore fill:#fff2cc,stroke:#333,stroke-width:2px;
    classDef shape fill:#ffe6cc,stroke:#333,stroke-width:2px;
    classDef testing fill:#ffcccc,stroke:#333,stroke-width:2px;
```
