# embedded-machine-learning/annette architecture

> Architecture diagram of the GitHub repository embedded-machine-learning/annette, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/embedded-machine-learning/annette
- Repository: https://github.com/embedded-machine-learning/annette

## Overview

##### Main Components Identification
The system should be represented with these key components:

a) Core Components:
- Estimation Module
- Benchmarking System
- Model Conversion Pipeline
- Database Storage
- Graph Processing

b) Supporting Components:
- Hardware Interfaces
- Configuration Management
- Utility Functions

**[Input Networks (.pb/.onnx)] → [Model Conversion] → [ANNETTE Format]**

**[Estimation Pipeline]**
- Mapping Models
- Layer-wise Models

**[Hardware Abstraction]**
- OpenVINO
- DNNDK
- NCS2

##### Detailed Component Breakdown

a) Estimation Module:
**[Layer Model] ─── [Mapping Model]**

- [Estimator] ─────┐
- [Results]
- [Benchmark Data] ────┘

b) Model Processing:
**[Input Networks] → [MMDNN/ONNX Converter] → [ANNETTE Format]**

- [Benchmark Runner] ───────────┘

##### Implementation Details

- Support for multiple frameworks (PyTorch, TensorFlow)
- Hardware acceleration support
- Benchmark data collection process
- Model optimization paths
- Result storage and analysis

##### Notes for Implementation

- Maintain consistent spacing and alignment
- Version information
- Brief descriptions for complex components
- Error handling paths

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        IN[".pb/.onnx Networks"]
    end

    subgraph "Model Conversion"
        MC["Model Converter"]:::conversion
        MMDNN["MMDNN/ONNX Converter"]:::conversion
        PT["PyTorch Conversion"]:::conversion
        AF["ANNETTE Format"]:::data
    end

    subgraph "Estimation Pipeline"
        LM["Layer Model"]:::estimation
        MM["Mapping Model"]:::estimation
        EST["Estimator"]:::estimation
        LC["Layer Components"]:::estimation
    end

    subgraph "Benchmarking System"
        BR["Benchmark Runner"]:::benchmark
        BE["Benchmark Execution"]:::benchmark
        CG["Config Generator"]:::benchmark
    end

    subgraph "Storage"
        DB_B["Benchmarks DB"]:::storage
        DB_G["Graph Storage"]:::storage
        DB_M["Model Storage"]:::storage
        CONF["Config Templates"]:::config
    end

    subgraph "Hardware Layer"
        DNNDK["DNNDK Interface"]:::hardware
        NCS2["NCS2 Interface"]:::hardware
        OPENVINO["OpenVINO"]:::hardware
    end

    %% Relationships
    IN --> MC
    MC --> MMDNN
    MMDNN --> AF
    MC --> PT
    PT --> AF

    AF --> EST
    LM --> EST
    MM --> EST
    LC --> LM

    EST --> BR
    BR --> BE
    CG --> BE
    BE --> DB_B

    DB_B --> EST
    DB_G --> EST
    DB_M --> EST
    CONF --> CG

    EST --> DNNDK
    EST --> NCS2
    EST --> OPENVINO

    %% Styles
    classDef estimation fill:#3498db
    classDef conversion fill:#9b59b6
    classDef benchmark fill:#e67e22
    classDef storage fill:#2ecc71
    classDef hardware fill:#e74c3c
    classDef config fill:#95a5a6
    classDef data fill:#f1c40f

    %% Click Events
    click MC "https://github.com/embedded-machine-learning/annette/blob/benchmark/src/annette/m2a.py"
    click PT "https://github.com/embedded-machine-learning/annette/blob/benchmark/src/annette/benchmark/pytorch_conversion.py"
    click LM "https://github.com/embedded-machine-learning/annette/blob/benchmark/src/annette/estimation/layer_model.py"
    click MM "https://github.com/embedded-machine-learning/annette/blob/benchmark/src/annette/estimation/mapping_model.py"
    click LC "https://github.com/embedded-machine-learning/annette/tree/benchmark/src/annette/estimation/layers/"
    click BR "https://github.com/embedded-machine-learning/annette/blob/benchmark/src/annette/benchmark/runner.py"
    click BE "https://github.com/embedded-machine-learning/annette/blob/benchmark/src/annette/benchmark/run_benchmarks.py"
    click CG "https://github.com/embedded-machine-learning/annette/blob/benchmark/src/annette/benchmark/gen_config.py"
    click DB_B "https://github.com/embedded-machine-learning/annette/tree/benchmark/database/benchmarks/"
    click DB_G "https://github.com/embedded-machine-learning/annette/tree/benchmark/database/graphs/"
    click DB_M "https://github.com/embedded-machine-learning/annette/tree/benchmark/database/models/"
    click CONF "https://github.com/embedded-machine-learning/annette/blob/benchmark/database/configs/config_template.yaml"
    click DNNDK "https://github.com/embedded-machine-learning/annette/tree/benchmark/src/annette/hardware/dnndk/"
    click NCS2 "https://github.com/embedded-machine-learning/annette/tree/benchmark/src/annette/hardware/ncs2/"
```
