# mayciii/object_scanner architecture

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

- Interactive diagram: https://gitdiagram.com/mayciii/object_scanner
- Repository: https://github.com/mayciii/object_scanner

## Overview

YOLO Voice Detector reads a phone or webcam stream, detects objects on the PC, announces newly detected or still-visible items, and displays annotated frames. The main loop coordinates inference, announcement policy, display, and keyboard controls; a background stream reader keeps frames current, while a queued speaker avoids blocking detection. The supplied excerpts show these runtime connections, but omit portions of the speaker and stream implementations, so uncertain internal links are left out.

Main entry points: [`main.py`](https://github.com/mayciii/object_scanner/blob/main/main.py) (Main loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Video input"]
  node_stream["Frame reader<br/>[main.py]"]
end

subgraph group_detection["Detection and display"]
  node_app["Main loop<br/>[main.py]"]
  node_yolo["YOLO inference<br/>[main.py]"]
  node_display["Annotated display<br/>[main.py]"]
end

subgraph group_speech["Voice announcements"]
  node_announcement["Announcement policy<br/>[main.py]"]
  node_phrasing["Detection phrasing<br/>[main.py]"]
  node_speaker["Queued speaker<br/>[main.py]"]
  node_tts["Speech synthesis<br/>[main.py]"]
end

node_camera(("Phone or webcam"))

node_camera -->|"supplies frames"| node_stream
node_app -->|"reads frames"| node_stream
node_app -->|"runs inference"| node_yolo
node_app -->|"checks detections"| node_announcement
node_announcement -->|"formats counts"| node_phrasing
node_announcement -->|"queues text"| node_speaker
node_speaker -.->|"speaks queued text"| node_tts
node_app -->|"shows annotated frame"| node_display

click node_stream "https://github.com/mayciii/object_scanner/blob/main/main.py"
click node_app "https://github.com/mayciii/object_scanner/blob/main/main.py"
click node_yolo "https://github.com/mayciii/object_scanner/blob/main/main.py"
click node_announcement "https://github.com/mayciii/object_scanner/blob/main/main.py"
click node_phrasing "https://github.com/mayciii/object_scanner/blob/main/main.py"
click node_speaker "https://github.com/mayciii/object_scanner/blob/main/main.py"
click node_tts "https://github.com/mayciii/object_scanner/blob/main/main.py"
click node_display "https://github.com/mayciii/object_scanner/blob/main/main.py"

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_stream toneBlue
class node_app,node_yolo,node_display toneAmber
class node_announcement,node_phrasing,node_speaker,node_tts toneMint
class node_camera toneIndigo
```

## Components

### Video input

- [Frame reader](https://github.com/mayciii/object_scanner/blob/main/main.py): `main.py`

### Detection and display

- [Main loop](https://github.com/mayciii/object_scanner/blob/main/main.py): `main.py`
- [YOLO inference](https://github.com/mayciii/object_scanner/blob/main/main.py): `main.py`
- [Annotated display](https://github.com/mayciii/object_scanner/blob/main/main.py): `main.py`

### Voice announcements

- [Announcement policy](https://github.com/mayciii/object_scanner/blob/main/main.py): `main.py`
- [Detection phrasing](https://github.com/mayciii/object_scanner/blob/main/main.py): `main.py`
- [Queued speaker](https://github.com/mayciii/object_scanner/blob/main/main.py): `main.py`
- [Speech synthesis](https://github.com/mayciii/object_scanner/blob/main/main.py): `main.py`

### Other components

- **Phone or webcam**

## Connections

- Phone or webcam → Frame reader: supplies frames (evidence: `README.md`)
- Main loop → Frame reader: reads frames (evidence: `main.py`)
- Main loop → YOLO inference: runs inference (evidence: `main.py`)
- Main loop → Announcement policy: checks detections (evidence: `main.py`)
- Announcement policy → Detection phrasing: formats counts (evidence: `main.py`)
- Announcement policy → Queued speaker: queues text (evidence: `main.py`)
- Queued speaker → Speech synthesis: speaks queued text (evidence: `main.py`)
- Main loop → Annotated display: shows annotated frame (evidence: `main.py`)
