# conglam56/circuitar architecture

> Architecture diagram of the GitHub repository conglam56/circuitar, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/conglam56/circuitar
- Repository: https://github.com/conglam56/circuitar

## Overview

This package is a Unity plugin for running MediaPipe CalculatorGraphs and handling their media inputs and outputs. The principal workflow is for a Unity application to prepare model assets, supply media to a configured graph, and use graph output for application rendering. The runtime also exposes image, audio, video, tensor, task-protocol, and GPU capabilities. The README is empty and most implementation files were not sampled, so the graph shows documented responsibilities and clear sampled calls without assuming internal graph wiring.

Main entry points: [`Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs`](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs) (Calculator graph), [`Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs`](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs) (GPU manager), [`Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager`](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager) (Asset managers), [`Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation`](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation) (Annotation controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_unity["Unity integration"]
  node_assetmanagers["Asset managers<br/>[ResourceManager]"]
  node_resourceutil["Resource resolver"]
  node_annotation["Annotation controllers<br/>[Annotation]"]
end

subgraph group_framework["Graph framework"]
  node_graphconfig["Graph configuration"]
  node_graph["Calculator graph<br/>[CalculatorGraph.cs]"]
  node_packets["Packets and timestamps<br/>[Packet.cs]"]
  node_poller["Output poller"]
  node_formats["Media formats<br/>[Formats]"]
end

subgraph group_processing["Media processing"]
  node_calculators["Calculator definitions<br/>[Calculators]"]
  node_taskoptions["Task graph options<br/>[Tasks]"]
  node_inference["Tensor inference"]
  node_vision["Vision workflows<br/>[Image]"]
  node_audio["Audio workflows<br/>[Audio]"]
  node_video["Video workflows<br/>[Video]"]
  node_taskmodules["Task modules<br/>[Vision]"]
end

subgraph group_gpu["GPU support"]
  node_gpumanager["GPU manager<br/>[GpuManager.cs]"]
  node_gpuresources["GPU resources<br/>[GpuResources.cs]"]
  node_glhelper["GL calculator helper"]
end

subgraph group_interop["Native interop"]
  node_marshal["Result marshalling<br/>[Marshal]"]
  node_native["Native bindings<br/>[PInvoke]"]
  node_handles["Native handles<br/>[Core]"]
end

node_app(("Unity application"))

node_app -->|"prepares assets"| node_assetmanagers
node_assetmanagers -->|"registers paths"| node_resourceutil
node_app -->|"provides configuration"| node_graphconfig
node_app -->|"uses graph"| node_graph
node_app -->|"provides media"| node_formats
node_graph -->|"accepts packets"| node_packets
node_graph -->|"exposes outputs"| node_poller
node_app -->|"reads results"| node_poller
node_app -->|"renders landmarks"| node_annotation
node_annotation -->|"draws annotations"| node_app
node_gpumanager -->|"creates resources"| node_gpuresources
node_gpumanager -->|"initializes helper"| node_glhelper

click node_assetmanagers "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager"
click node_resourceutil "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs"
click node_annotation "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation"
click node_graphconfig "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs"
click node_graph "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs"
click node_packets "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet.cs"
click node_poller "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs"
click node_formats "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats"
click node_calculators "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators"
click node_taskoptions "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks"
click node_inference "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs"
click node_vision "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image"
click node_audio "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio"
click node_video "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video"
click node_taskmodules "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision"
click node_marshal "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Marshal"
click node_native "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke"
click node_handles "https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core"
click node_gpumanager "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs"
click node_gpuresources "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs"
click node_glhelper "https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_assetmanagers,node_resourceutil,node_annotation toneBlue
class node_graphconfig,node_graph,node_packets,node_poller,node_formats toneAmber
class node_calculators,node_taskoptions,node_inference,node_vision,node_audio,node_video,node_taskmodules toneMint
class node_gpumanager,node_gpuresources,node_glhelper toneRose
class node_marshal,node_native,node_handles,node_app toneIndigo
```

## Components

### Unity integration

- [Asset managers](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/ResourceManager`
- [Resource resolver](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/Util/ResourceUtil_Safe.cs`
- [Annotation controllers](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/Annotation`

### Graph framework

- [Graph configuration](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/ValidatedGraphConfig.cs`
- [Calculator graph](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/CalculatorGraph.cs`
- [Packets and timestamps](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet.cs`
- [Output poller](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/OutputStreamPoller.cs`
- [Media formats](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Formats`

### Media processing

- [Calculator definitions](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators`
- [Task graph options](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks`
- [Tensor inference](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Tensor/InferenceCalculator.cs`
- [Vision workflows](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Image`
- [Audio workflows](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Audio`
- [Video workflows](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Calculators/Video`
- [Task modules](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision`

### GPU support

- [GPU manager](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/GpuManager.cs`
- [GPU resources](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GpuResources.cs`
- [GL calculator helper](https://github.com/conglam56/circuitar/blob/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Gpu/GlCalculatorHelper.cs`

### Native interop

- [Result marshalling](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Marshal): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Marshal`
- [Native bindings](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke`
- [Native handles](https://github.com/conglam56/circuitar/tree/main/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core): `Packages/com.github.homuler.mediapipe/Runtime/Scripts/Core`

### Other components

- **Unity application**

## Connections

- Unity application → Asset managers: prepares assets
- Asset managers → Resource resolver: registers paths
- Unity application → Graph configuration: provides configuration
- Unity application → Calculator graph: uses graph
- Unity application → Media formats: provides media
- Calculator graph → Packets and timestamps: accepts packets
- Calculator graph → Output poller: exposes outputs
- Unity application → Output poller: reads results
- Unity application → Annotation controllers: renders landmarks
- Annotation controllers → Unity application: draws annotations
- GPU manager → GPU resources: creates resources
- GPU manager → GL calculator helper: initializes helper
