# ryok3n/vmp2d architecture

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

- Interactive diagram: https://gitdiagram.com/ryok3n/vmp2d
- Repository: https://github.com/ryok3n/vmp2d

## Overview

##### Project type and purpose
- This is a machine‑learning research/experiment codebase for “2D visual mesh prediction” used in pose estimation.
- It is neither a web application nor a microservice setup, but rather a standalone ML pipeline: data ingestion → model training → evaluation → visualization.

##### File structure
- Top‑level Python modules each encapsulate a stage or utility:
- dataloader.py – data ingestion & preprocessing
- model.py – neural network definition
- loss.py – custom loss computations
- train.py – orchestrates the training loop
- eval_wrap.py – evaluation logic & metrics
- tensorboard.py – logging to TensorBoard
- vis.py – visualization of predictions
- rot.py – rotation‑related math utilities
- utils.py – miscellaneous helper functions
- dataloader.py & utils.py suggest separation of concerns for data vs. other utilities.
- There are no subdirectories; all components are flat, each module serving a clear role.

##### Key insights from the README
- The README indicates missing “data/” directory—data is external.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Data Source
    DS["Data Source (external data/)"]:::external

    subgraph "Training Pipeline"
        DataLoader["dataloader.py\nData Loader & Preprocessor"]:::data
        Train["train.py\nTraining Controller"]:::model
        Model["model.py\nModel Definition"]:::model
        Loss["loss.py\nLoss Computation"]:::model
    end

    subgraph "Evaluation & Visualization"
        Eval["eval_wrap.py\nEvaluation Wrapper"]:::eval
        Vis["vis.py\nVisualization Module"]:::eval
    end

    Tensor["tensorboard.py\nLogging Service"]:::log

    subgraph "Utilities"
        Rot["rot.py\nRotation Utilities"]:::utils
        Utils["utils.py\nMiscellaneous Utilities"]:::utils
    end

    %% Data Flow
    DS -->|ingest| DataLoader
    DataLoader -->|batch→train| Train
    Train -->|batch→model| Model
    Train -->|batch→loss| Loss
    Train -->|metrics→tensorboard| Tensor
    Train -->|epoch-end→eval| Eval
    Eval -->|results→vis| Vis

    %% Utility Dependencies (dotted lines)
    Rot -.-> DataLoader
    Rot -.-> Model
    Rot -.-> Loss
    Rot -.-> Train
    Rot -.-> Eval
    Rot -.-> Vis
    Utils -.-> DataLoader
    Utils -.-> Model
    Utils -.-> Loss
    Utils -.-> Train
    Utils -.-> Eval
    Utils -.-> Vis

    %% Click Events
    click DataLoader "https://github.com/ryok3n/vmp2d/blob/main/dataloader.py"
    click Model "https://github.com/ryok3n/vmp2d/blob/main/model.py"
    click Loss "https://github.com/ryok3n/vmp2d/blob/main/loss.py"
    click Train "https://github.com/ryok3n/vmp2d/blob/main/train.py"
    click Eval "https://github.com/ryok3n/vmp2d/blob/main/eval_wrap.py"
    click Tensor "https://github.com/ryok3n/vmp2d/blob/main/tensorboard.py"
    click Vis "https://github.com/ryok3n/vmp2d/blob/main/vis.py"
    click Rot "https://github.com/ryok3n/vmp2d/blob/main/rot.py"
    click Utils "https://github.com/ryok3n/vmp2d/blob/main/utils.py"

    %% Styles
    classDef data fill:#add8e6,stroke:#333,stroke-width:1px
    classDef model fill:#90ee90,stroke:#333,stroke-width:1px
    classDef eval fill:#ffa500,stroke:#333,stroke-width:1px
    classDef log fill:#dda0dd,stroke:#333,stroke-width:1px
    classDef utils fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef external fill:#e0ffff,stroke:#333,stroke-width:1px
```
