# google-ai-edge/mediapipe-samples architecture

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

- Interactive diagram: https://gitdiagram.com/google-ai-edge/mediapipe-samples
- Repository: https://github.com/google-ai-edge/mediapipe-samples

## Overview

This repository is a collection of official MediaPipe sample apps and codelabs, not the MediaPipe platform itself. One fully evidenced workflow is the Android digit-classifier codelab: a user draws a digit, the canvas passes its bitmap to a helper, and the helper invokes MediaPipe image classification and reports results to the UI. The tree also shows audio and face examples across platforms, plus customization and LiteRT notebooks. Those branches are represented by their source directories; their internal wiring was not sampled, so no speculative edges are drawn.

Main entry points: [`codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitClassifierHelper.kt`](https://github.com/google-ai-edge/mediapipe-samples/blob/main/codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitClassifierHelper.kt) (Classifier helper), [`codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitCanvasFragment.kt`](https://github.com/google-ai-edge/mediapipe-samples/blob/main/codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitCanvasFragment.kt) (Drawing canvas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_digit["Digit codelab"]
  node_main["Activity shell<br/>[MainActivity.kt]"]
  node_canvas["Drawing canvas"]
  node_helper["Classifier helper"]
end

subgraph group_audio["Audio samples"]
  node_audio_android["Android audio"]
  node_audio_ios["iOS audio"]
  node_audio_python["Python audio"]
  node_audio_pi["Raspberry Pi audio"]
end

subgraph group_face["Face samples"]
  node_face_android["Android face detection"]
  node_face_ios["iOS face detection"]
end

subgraph group_notebooks["ML notebooks"]
  node_customize["Task customization"]
  node_litert["LiteRT inference"]
end

node_user(("App user"))
node_mediapipe{{"Image Classifier"}}

node_user -->|"draws on"| node_canvas
node_canvas -->|"sends bitmap"| node_helper
node_helper -->|"runs classification"| node_mediapipe
node_helper -->|"returns results"| node_canvas

click node_main "https://github.com/google-ai-edge/mediapipe-samples/blob/main/codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/MainActivity.kt"
click node_canvas "https://github.com/google-ai-edge/mediapipe-samples/blob/main/codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitCanvasFragment.kt"
click node_helper "https://github.com/google-ai-edge/mediapipe-samples/blob/main/codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitClassifierHelper.kt"
click node_audio_android "https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/audio_classifier/android/app/src/main/java/com/google/mediapipe/examples/audioclassifier"
click node_audio_ios "https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/audio_classifier/ios/AudioClassifier"
click node_audio_python "https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/audio_classifier/python/audio_classification_live_stream"
click node_audio_pi "https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/audio_classifier/raspberry_pi"
click node_face_android "https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/face_detector/android/app/src/main/java/com/google/mediapipe/examples/facedetection"
click node_face_ios "https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/face_detector/ios/FaceDetector"
click node_customize "https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/customization"
click node_litert "https://github.com/google-ai-edge/mediapipe-samples/tree/main/codelabs/litert_inference"

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_main,node_canvas,node_helper,node_user toneBlue
class node_audio_android,node_audio_ios,node_audio_python,node_audio_pi toneAmber
class node_face_android,node_face_ios toneMint
class node_customize,node_litert toneRose
class node_mediapipe toneIndigo
```

## Components

### Digit codelab

- [Activity shell](https://github.com/google-ai-edge/mediapipe-samples/blob/main/codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/MainActivity.kt): `codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/MainActivity.kt`
- [Drawing canvas](https://github.com/google-ai-edge/mediapipe-samples/blob/main/codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitCanvasFragment.kt): `codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitCanvasFragment.kt`
- [Classifier helper](https://github.com/google-ai-edge/mediapipe-samples/blob/main/codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitClassifierHelper.kt): `codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitClassifierHelper.kt`

### Audio samples

- [Android audio](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/audio_classifier/android/app/src/main/java/com/google/mediapipe/examples/audioclassifier): `examples/audio_classifier/android/app/src/main/java/com/google/mediapipe/examples/audioclassifier`
- [iOS audio](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/audio_classifier/ios/AudioClassifier): `examples/audio_classifier/ios/AudioClassifier`
- [Python audio](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/audio_classifier/python/audio_classification_live_stream): `examples/audio_classifier/python/audio_classification_live_stream`
- [Raspberry Pi audio](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/audio_classifier/raspberry_pi): `examples/audio_classifier/raspberry_pi`

### Face samples

- [Android face detection](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/face_detector/android/app/src/main/java/com/google/mediapipe/examples/facedetection): `examples/face_detector/android/app/src/main/java/com/google/mediapipe/examples/facedetection`
- [iOS face detection](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/face_detector/ios/FaceDetector): `examples/face_detector/ios/FaceDetector`

### ML notebooks

- [Task customization](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/customization): `examples/customization`
- [LiteRT inference](https://github.com/google-ai-edge/mediapipe-samples/tree/main/codelabs/litert_inference): `codelabs/litert_inference`

### Other components

- **App user**
- **Image Classifier**

## Connections

- App user → Drawing canvas: draws on (evidence: `codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitCanvasFragment.kt`)
- Drawing canvas → Classifier helper: sends bitmap (evidence: `codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitCanvasFragment.kt`)
- Classifier helper → Image Classifier: runs classification (evidence: `codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitClassifierHelper.kt`)
- Classifier helper → Drawing canvas: returns results (evidence: `codelabs/digitclassifier/android/finish/app/src/main/java/com/google/mediapipe/codelab/digitclassifier/DigitClassifierHelper.kt`)
