# ayushagarwal-05/cat-meme-cam architecture

> Architecture diagram of the GitHub repository ayushagarwal-05/cat-meme-cam, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ayushagarwal-05/cat-meme-cam
- Repository: https://github.com/ayushagarwal-05/cat-meme-cam

## Overview

Gesture Meme Detector has two runtime paths: a browser app and a Python desktop app. Each captures webcam video, detects hand/face or motion cues, classifies gestures, and displays the matching meme; the desktop path also supports video memes. The README documents both workflows and browser-hosted MediaPipe models. Source excerpts show implementation details for detection and selection, but the browser shell and full desktop loop were not sampled, so some connections rely on README documentation.

Main entry points: [`app.js`](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/app.js) (Vision pipeline), [`gesture_meme.py`](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py) (Vision detection), [`index.html`](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/index.html) (Browser UI), [`memes`](https://github.com/ayushagarwal-05/cat-meme-cam/tree/main/memes) (Meme media)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser runtime"]
  node_browser_ui["Browser UI<br/>[index.html]"]
  node_browser_pipeline["Vision pipeline<br/>[app.js]"]
  node_browser_classify["Gesture classifier<br/>[app.js]"]
  node_browser_display["Meme display<br/>[app.js]"]
  node_browser_shell["Page shell<br/>[index.html]"]
end

subgraph group_desktop["Desktop runtime"]
  node_desktop_capture["Desktop capture<br/>[gesture_meme.py]"]
  node_desktop_vision["Vision detection<br/>[gesture_meme.py]"]
  node_desktop_state["Gesture state<br/>[gesture_meme.py]"]
  node_desktop_display["Desktop display<br/>[gesture_meme.py]"]
  node_alternate_desktop["Earlier desktop variant"]
end

subgraph group_assets["Runtime assets"]
  node_memes["Meme media"]
  node_models["Task models"]
end

subgraph group_external["External services"]
  node_mediapipe{{"MediaPipe CDN"}}
  node_webcam{{"Webcam"}}
end

node_user(("Camera user"))

node_user -->|"opens"| node_browser_ui
node_browser_ui -->|"runs"| node_browser_pipeline
node_webcam -->|"streams video"| node_browser_pipeline
node_browser_pipeline -->|"loads vision models"| node_mediapipe
node_browser_pipeline -->|"supplies landmarks"| node_browser_classify
node_browser_classify -->|"selects gesture"| node_browser_display
node_browser_display -->|"shows meme"| node_memes
node_user -->|"runs app"| node_desktop_capture
node_webcam -->|"streams video"| node_desktop_capture
node_desktop_capture -->|"provides frames"| node_desktop_vision
node_desktop_vision -->|"loads task files"| node_models
node_desktop_vision -->|"updates landmarks"| node_desktop_state
node_desktop_state -->|"returns gesture"| node_desktop_display
node_desktop_display -->|"shows or plays media"| node_memes

click node_browser_ui "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/index.html"
click node_browser_pipeline "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/app.js"
click node_browser_classify "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/app.js"
click node_browser_display "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/app.js"
click node_desktop_capture "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py"
click node_desktop_vision "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py"
click node_desktop_state "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py"
click node_desktop_display "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py"
click node_alternate_desktop "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.WORKED_AT_ALBERTS_HOUSE.py"
click node_browser_shell "https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/index.html"
click node_memes "https://github.com/ayushagarwal-05/cat-meme-cam/tree/main/memes"
click node_models "https://github.com/ayushagarwal-05/cat-meme-cam/tree/main/models"

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_browser_ui,node_browser_pipeline,node_browser_classify,node_browser_display,node_browser_shell,node_user toneBlue
class node_desktop_capture,node_desktop_vision,node_desktop_state,node_desktop_display,node_alternate_desktop toneAmber
class node_memes,node_models toneMint
class node_mediapipe,node_webcam toneRose
```

## Components

### Browser runtime

- [Browser UI](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/index.html): `index.html`
- [Vision pipeline](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/app.js): `app.js`
- [Gesture classifier](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/app.js): `app.js`
- [Meme display](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/app.js): `app.js`
- [Page shell](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/index.html): `index.html`

### Desktop runtime

- [Desktop capture](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py): `gesture_meme.py`
- [Vision detection](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py): `gesture_meme.py`
- [Gesture state](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py): `gesture_meme.py`
- [Desktop display](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.py): `gesture_meme.py`
- [Earlier desktop variant](https://github.com/ayushagarwal-05/cat-meme-cam/blob/main/gesture_meme.WORKED_AT_ALBERTS_HOUSE.py): `gesture_meme.WORKED_AT_ALBERTS_HOUSE.py`

### Runtime assets

- [Meme media](https://github.com/ayushagarwal-05/cat-meme-cam/tree/main/memes): `memes`
- [Task models](https://github.com/ayushagarwal-05/cat-meme-cam/tree/main/models): `models`

### External services

- **MediaPipe CDN**
- **Webcam**

### Other components

- **Camera user**

## Connections

- Camera user → Browser UI: opens (evidence: `README.md`)
- Browser UI → Vision pipeline: runs (evidence: `README.md`)
- Webcam → Vision pipeline: streams video (evidence: `app.js`)
- Vision pipeline → MediaPipe CDN: loads vision models (evidence: `app.js`)
- Vision pipeline → Gesture classifier: supplies landmarks (evidence: `app.js`)
- Gesture classifier → Meme display: selects gesture (evidence: `app.js`)
- Meme display → Meme media: shows meme (evidence: `README.md`)
- Camera user → Desktop capture: runs app (evidence: `README.md`)
- Webcam → Desktop capture: streams video (evidence: `README.md`)
- Desktop capture → Vision detection: provides frames (evidence: `gesture_meme.py`)
- Vision detection → Task models: loads task files (evidence: `gesture_meme.py`)
- Vision detection → Gesture state: updates landmarks (evidence: `gesture_meme.py`)
- Gesture state → Desktop display: returns gesture (evidence: `gesture_meme.py`)
- Desktop display → Meme media: shows or plays media (evidence: `gesture_meme.py`)
