# wuyoueeee/motorcycle architecture

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

- Interactive diagram: https://gitdiagram.com/wuyoueeee/motorcycle
- Repository: https://github.com/wuyoueeee/motorcycle

## Overview

This is a browser/server electric-bike-in-elevator detection and safety-alert system. Its documented workflow accepts camera streams, video, or image batches; processes frames with YOLO detection and risk logic; then issues visual/audio alerts and records events for dashboard analysis. Other documented capabilities include live monitoring, offline batch analysis, CSV export, and optional LLaVA semantic analysis. Only the README is available, so paths point to it and edges reflect documented relationships; implementation details and unshown connections are omitted.

Main entry points: [`README.md`](https://github.com/wuyoueeee/motorcycle/blob/main/README.md) (Alert Trigger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data Inputs"]
  node_camera["Camera Stream"]
  node_video["Video File"]
  node_images["Batch Images"]
  node_processor["Video Processor<br/>[README.md]"]
end

subgraph group_detection["Detection Core"]
  node_yolo["YOLO Detection<br/>[README.md]"]
  node_risk["Risk Logic<br/>[README.md]"]
  node_safe["Safe Pass<br/>[README.md]"]
end

subgraph group_response["Alerts and Records"]
  node_alert["Alert Trigger<br/>[README.md]"]
  node_visual["Visual Alert<br/>[README.md]"]
  node_audio["Audio Alarm<br/>[README.md]"]
  node_sqlite[("SQLite Log<br/>[README.md]")]
end

subgraph group_interface["Web Interface"]
  node_webui["Gradio WebUI<br/>[README.md]"]
  node_dashboard["Dashboard Analysis<br/>[README.md]"]
  node_export["CSV Export<br/>[README.md]"]
end

subgraph group_extensions["Optional Analysis"]
  node_llava["LLaVA Analysis<br/>[README.md]"]
  node_ollama["Ollama Service"]
end

node_operator(("Operator"))

node_camera -->|"streams to"| node_processor
node_video -->|"uploads to"| node_processor
node_images -->|"loads into"| node_processor
node_processor -->|"sends frames"| node_yolo
node_yolo -->|"flags risk"| node_risk
node_yolo -->|"passes safe"| node_safe
node_risk -->|"triggers above threshold"| node_alert
node_alert -->|"triggers"| node_visual
node_alert -->|"triggers"| node_audio
node_alert -->|"logs event"| node_sqlite
node_visual -->|"displays on"| node_webui
node_audio -->|"reports on"| node_webui
node_sqlite -->|"feeds analysis"| node_dashboard
node_operator -->|"accesses"| node_webui
node_sqlite -->|"exports records"| node_export
node_webui -.->|"requests semantic analysis"| node_llava
node_llava -->|"uses model service"| node_ollama

click node_processor "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_yolo "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_risk "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_safe "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_alert "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_visual "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_audio "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_sqlite "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_webui "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_dashboard "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_export "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"
click node_llava "https://github.com/wuyoueeee/motorcycle/blob/main/README.md"

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_camera,node_video,node_images,node_processor toneBlue
class node_yolo,node_risk,node_safe toneAmber
class node_alert,node_visual,node_audio,node_sqlite toneMint
class node_webui,node_dashboard,node_export toneRose
class node_llava,node_ollama,node_operator toneIndigo
```

## Components

### Data Inputs

- **Camera Stream**
- **Video File**
- **Batch Images**
- [Video Processor](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`

### Detection Core

- [YOLO Detection](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`
- [Risk Logic](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`
- [Safe Pass](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`

### Alerts and Records

- [Alert Trigger](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`
- [Visual Alert](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`
- [Audio Alarm](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`
- [SQLite Log](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`

### Web Interface

- [Gradio WebUI](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`
- [Dashboard Analysis](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`
- [CSV Export](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`

### Optional Analysis

- [LLaVA Analysis](https://github.com/wuyoueeee/motorcycle/blob/main/README.md): `README.md`
- **Ollama Service**

### Other components

- **Operator**

## Connections

- Camera Stream → Video Processor: streams to (evidence: `README.md`)
- Video File → Video Processor: uploads to (evidence: `README.md`)
- Batch Images → Video Processor: loads into (evidence: `README.md`)
- Video Processor → YOLO Detection: sends frames (evidence: `README.md`)
- YOLO Detection → Risk Logic: flags risk (evidence: `README.md`)
- YOLO Detection → Safe Pass: passes safe (evidence: `README.md`)
- Risk Logic → Alert Trigger: triggers above threshold (evidence: `README.md`)
- Alert Trigger → Visual Alert: triggers (evidence: `README.md`)
- Alert Trigger → Audio Alarm: triggers (evidence: `README.md`)
- Alert Trigger → SQLite Log: logs event (evidence: `README.md`)
- Visual Alert → Gradio WebUI: displays on (evidence: `README.md`)
- Audio Alarm → Gradio WebUI: reports on (evidence: `README.md`)
- SQLite Log → Dashboard Analysis: feeds analysis (evidence: `README.md`)
- Operator → Gradio WebUI: accesses (evidence: `README.md`)
- SQLite Log → CSV Export: exports records (evidence: `README.md`)
- Gradio WebUI → LLaVA Analysis: requests semantic analysis
- LLaVA Analysis → Ollama Service: uses model service (evidence: `README.md`)
