# redah13/yolov8-object-detection architecture

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

- Interactive diagram: https://gitdiagram.com/redah13/yolov8-object-detection
- Repository: https://github.com/redah13/yolov8-object-detection

## Overview

LiveDetekt combines a PyQt desktop client for biometric-gated object detection with a Flask authentication backend backed by SQL Server. The user flow starts at the welcome screen, proceeds through facial registration or login, then opens a dashboard for webcam, image, or video analysis; YOLO results feed visual overlays and analytics. The graph covers the principal UI, inference, and authentication layers. Some mode-switching and deployment details are documented but not fully sampled, so those links are identified as documented or left unverified.

Main entry points: [`gui/detect_window.py`](https://github.com/redah13/yolov8-object-detection/blob/main/gui/detect_window.py) (Detection dashboard), [`backend/services.py`](https://github.com/redah13/yolov8-object-detection/blob/main/backend/services.py) (Face registration and verification), [`main.py`](https://github.com/redah13/yolov8-object-detection/blob/main/main.py) (App navigation), [`gui/auth_window.py`](https://github.com/redah13/yolov8-object-detection/blob/main/gui/auth_window.py) (Auth window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Desktop client"]
  node_launcher["App navigation<br/>[main.py]"]
  node_welcome["Welcome screen<br/>[welcome_window.py]"]
  node_auth_ui["Auth window<br/>[auth_window.py]"]
end

subgraph group_vision["Detection and analytics"]
  node_dashboard["Detection dashboard<br/>[detect_window.py]"]
  node_file_analysis["Image/video analysis"]
  node_widgets["Dashboard widgets<br/>[widgets.py]"]
  node_inference["YOLO inference<br/>[predict.py]"]
  node_weights["Model weights<br/>[best.pt]"]
end

subgraph group_auth["Biometric authentication"]
  node_api["Flask auth API<br/>[app.py]"]
  node_auth_logic["Face registration and verification<br/>[services.py]"]
end

subgraph group_storage["Authentication storage"]
  node_db_config["SQL connection config<br/>[config.py]"]
  node_sqlserver[("SQL Server users")]
end

node_user(("User"))
node_face_recognition["Face recognition library"]

node_user -->|"starts at"| node_welcome
node_welcome -->|"signals start"| node_launcher
node_launcher -->|"opens auth"| node_auth_ui
node_auth_ui -->|"sends auth requests"| node_api
node_api -->|"routes register/login"| node_auth_logic
node_auth_logic -->|"uses connection settings"| node_db_config
node_auth_logic -->|"reads/writes users"| node_sqlserver
node_auth_logic -->|"encodes and compares faces"| node_face_recognition
node_auth_ui -->|"signals success"| node_launcher
node_launcher -->|"opens dashboard"| node_dashboard
node_dashboard -->|"detects frames"| node_inference
node_file_analysis -->|"detects file frames"| node_inference
node_inference -->|"loads model"| node_weights
node_dashboard -->|"renders analytics"| node_widgets
node_dashboard -.->|"opens file modes"| node_file_analysis

click node_launcher "https://github.com/redah13/yolov8-object-detection/blob/main/main.py"
click node_welcome "https://github.com/redah13/yolov8-object-detection/blob/main/gui/welcome_window.py"
click node_auth_ui "https://github.com/redah13/yolov8-object-detection/blob/main/gui/auth_window.py"
click node_dashboard "https://github.com/redah13/yolov8-object-detection/blob/main/gui/detect_window.py"
click node_file_analysis "https://github.com/redah13/yolov8-object-detection/blob/main/gui/image_video_window.py"
click node_widgets "https://github.com/redah13/yolov8-object-detection/blob/main/gui/widgets.py"
click node_inference "https://github.com/redah13/yolov8-object-detection/blob/main/backend/detection/predict.py"
click node_weights "https://github.com/redah13/yolov8-object-detection/blob/main/yolo_models/best.pt"
click node_api "https://github.com/redah13/yolov8-object-detection/blob/main/backend/app.py"
click node_auth_logic "https://github.com/redah13/yolov8-object-detection/blob/main/backend/services.py"
click node_db_config "https://github.com/redah13/yolov8-object-detection/blob/main/backend/config.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_launcher,node_welcome,node_auth_ui,node_user toneBlue
class node_dashboard,node_file_analysis,node_widgets,node_inference,node_weights toneAmber
class node_api,node_auth_logic toneMint
class node_db_config,node_sqlserver toneRose
class node_face_recognition toneIndigo
```

## Components

### Desktop client

- [App navigation](https://github.com/redah13/yolov8-object-detection/blob/main/main.py): `main.py`
- [Welcome screen](https://github.com/redah13/yolov8-object-detection/blob/main/gui/welcome_window.py): `gui/welcome_window.py`
- [Auth window](https://github.com/redah13/yolov8-object-detection/blob/main/gui/auth_window.py): `gui/auth_window.py`

### Detection and analytics

- [Detection dashboard](https://github.com/redah13/yolov8-object-detection/blob/main/gui/detect_window.py): `gui/detect_window.py`
- [Image/video analysis](https://github.com/redah13/yolov8-object-detection/blob/main/gui/image_video_window.py): `gui/image_video_window.py`
- [Dashboard widgets](https://github.com/redah13/yolov8-object-detection/blob/main/gui/widgets.py): `gui/widgets.py`
- [YOLO inference](https://github.com/redah13/yolov8-object-detection/blob/main/backend/detection/predict.py): `backend/detection/predict.py`
- [Model weights](https://github.com/redah13/yolov8-object-detection/blob/main/yolo_models/best.pt): `yolo_models/best.pt`

### Biometric authentication

- [Flask auth API](https://github.com/redah13/yolov8-object-detection/blob/main/backend/app.py): `backend/app.py`
- [Face registration and verification](https://github.com/redah13/yolov8-object-detection/blob/main/backend/services.py): `backend/services.py`

### Authentication storage

- [SQL connection config](https://github.com/redah13/yolov8-object-detection/blob/main/backend/config.py): `backend/config.py`
- **SQL Server users**

### Other components

- **User**
- **Face recognition library**

## Connections

- User → Welcome screen: starts at (evidence: `README.md`)
- Welcome screen → App navigation: signals start (evidence: `main.py`)
- App navigation → Auth window: opens auth (evidence: `main.py`)
- Auth window → Flask auth API: sends auth requests (evidence: `gui/auth_window.py`)
- Flask auth API → Face registration and verification: routes register/login (evidence: `backend/app.py`)
- Face registration and verification → SQL connection config: uses connection settings (evidence: `backend/services.py`)
- Face registration and verification → SQL Server users: reads/writes users (evidence: `backend/services.py`)
- Face registration and verification → Face recognition library: encodes and compares faces (evidence: `backend/services.py`)
- Auth window → App navigation: signals success (evidence: `main.py`)
- App navigation → Detection dashboard: opens dashboard (evidence: `main.py`)
- Detection dashboard → YOLO inference: detects frames (evidence: `gui/detect_window.py`)
- Image/video analysis → YOLO inference: detects file frames (evidence: `gui/image_video_window.py`)
- YOLO inference → Model weights: loads model (evidence: `backend/detection/predict.py`)
- Detection dashboard → Dashboard widgets: renders analytics (evidence: `gui/detect_window.py`)
- Detection dashboard → Image/video analysis: opens file modes (evidence: `README.md`)
