# weilly0912/atu_nxp_ai_demo architecture

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

- Interactive diagram: https://gitdiagram.com/weilly0912/atu_nxp_ai_demo
- Repository: https://github.com/weilly0912/atu_nxp_ai_demo

## Overview

##### High-Level Architecture Components

a) Input Layer:
- Image input (static files)
- Camera input (real-time)

b) Processing Layer:
- TensorFlow Lite Runtime Environment
- Hardware Acceleration Delegates:
- Verisilicon Vivante NPU (for i.MX8M Plus)
- ARM Ethos-U65 NPU (for i.MX 93)
- Model Processing Pipeline

c) Model Repository:
- Object Detection (YOLOv3, YOLOv4, YOLOv5, YOLOv8)
- Segmentation Models
- Pose Estimation
- Face Detection/Recognition
- Special Purpose Models (PCB Detection, Hand Detection, etc.)

d) Output Layer:
- Processing results
- Save output options

##### Data Flow Representation

- Input data flow from sources to processing
- Model loading from repository to runtime
- Processing results to output
- Hardware acceleration paths

##### Implementation Details

- Notes about supported platforms
- Version information
- Command-line parameter options
- Supported model formats

Remember to use standard symbols for:
- Input/Output devices
- Processing units
- Storage/repositories
- Data flow directions
- Decision points
- Hardware accelerators

This will create a comprehensive yet understandable representation of the system's architecture that highlights both its capabilities and implementation details.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Input Layer
    subgraph Input
        SI["Static Images"]:::input
        VI["Video Input"]:::input
    end

    %% Processing Layer
    subgraph Processing
        TFR["TensorFlow Lite Runtime"]:::processing
        
        subgraph "Hardware Acceleration"
            VIV["Verisilicon Vivante NPU"]:::hardware
            ARM["ARM Ethos-U65 NPU"]:::hardware
        end
        
        PP["Processing Pipeline"]:::processing
    end

    %% Model Repository
    subgraph Models
        direction TB
        subgraph "Object Detection"
            YOLOv8["YOLOv8n Models"]:::model
            MobileNet["MobileNetSSD Models"]:::model
        end
        
        subgraph "Segmentation"
            YOLOv8s["YOLOv8s Models"]:::model
            Deeplab["DeeplabV3 Models"]:::model
        end
        
        subgraph "Pose Estimation"
            YOLOv8p["YOLOv8s Pose"]:::model
            MobileNetP["MobileNet Pose"]:::model
        end
        
        subgraph "Face Analysis"
            Blaze["BlazeFace"]:::model
            Facenet["Facenet"]:::model
        end
        
        subgraph "Special Purpose"
            PCB["YOLOv5s PCB"]:::model
            Hand["Hand Skeleton"]:::model
        end
    end

    %% Output Layer
    subgraph Output
        PR["Processing Results"]:::output
        SO["Saved Output"]:::output
    end

    %% Connections
    SI --> PP
    VI --> PP
    PP --> TFR
    TFR --> VIV
    TFR --> ARM
    VIV --> PR
    ARM --> PR
    PR --> SO
    
    Models --> TFR

    %% Click Events
    click SI "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/*/img/"
    click VI "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/_VideoCap_YUV2RGB_byGPU/"
    click YOLOv8 "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/YOLOv8n_ObjectDetect/model/"
    click MobileNet "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/MobileNetSSD_ObjectDetector/model/"
    click YOLOv8s "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/YOLOv8s_ObjectSegmataion/model/"
    click Deeplab "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/DeeplabV3_SegmationObjection/model/"
    click YOLOv8p "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/YOLOv8s_PoseEstimation/model/"
    click MobileNetP "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/MobileNet_PoseEstimation/model/"
    click Blaze "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/BlazeFace/model/"
    click Facenet "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/Facenet_FaceRecognition/model/"
    click PCB "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/YOLOv5s_PCBDetector/model/"
    click Hand "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/HandSkeletonDetect_Mediapipe/model/"
    click ARM "https://github.com/weilly0912/ATU_NXP_AI_DEMO/blob/v12.0/*/model/*_vela.tflite"
    click SO "https://github.com/weilly0912/ATU_NXP_AI_DEMO/tree/v12.0/TensorflowLite_DEMO/*/output/"
    click PP "https://github.com/weilly0912/ATU_NXP_AI_DEMO/blob/v12.0/TensorflowLite_DEMO/*/app.py"

    %% Styling
    classDef input fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef processing fill:#90EE90,stroke:#333,stroke-width:2px
    classDef hardware fill:#FFB347,stroke:#333,stroke-width:2px
    classDef model fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef output fill:#87CEEB,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Processing Components"]:::processing
        L3["Hardware Acceleration"]:::hardware
        L4["Model Components"]:::model
        L5["Output Components"]:::output
    end
```
