# 0buloy/yolov8uniformdetection architecture

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

- Interactive diagram: https://gitdiagram.com/0buloy/yolov8uniformdetection
- Repository: https://github.com/0buloy/yolov8uniformdetection

## Overview

This repository implements a webcam-based student uniform checker. Student records can be seeded in Firebase; a separate preparation script uploads student images and generates face encodings. The live application recognizes a student, retrieves their record, checks detected uniform items against gender-specific requirements, and emails an alert for an incomplete uniform. The excerpts show these responsibilities, but omit parts of the live model setup and do not establish how the generated encoding file is loaded.

Main entry points: [`final.py`](https://github.com/0buloy/yolov8uniformdetection/blob/main/final.py) (Recognize and Screen), [`AddDatatoDatabase.py`](https://github.com/0buloy/yolov8uniformdetection/blob/main/AddDatatoDatabase.py) (Seed Student Records), [`EncodeGenerator.py`](https://github.com/0buloy/yolov8uniformdetection/blob/main/EncodeGenerator.py) (Build Face Encodings), [`v8.pt`](https://github.com/0buloy/yolov8uniformdetection/blob/main/v8.pt) (Detection Weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Student Setup"]
  node_seed["Seed Student Records"]
  node_encode["Build Face Encodings<br/>[EncodeGenerator.py]"]
end

subgraph group_screening["Live Screening"]
  node_live["Recognize and Screen<br/>[final.py]"]
  node_weights["Detection Weights<br/>[v8.pt]"]
end

subgraph group_services["External Services"]
  node_students[("Firebase Students")]
  node_storage[("Firebase Image Storage")]
  node_camera["Webcam"]
  node_mail["SMTP Email"]
end

node_operator(("Operator"))

node_operator -->|"seeds records"| node_seed
node_seed -->|"writes records"| node_students
node_operator -->|"prepares images"| node_encode
node_encode -->|"uploads images"| node_storage
node_operator -->|"starts checker"| node_live
node_camera -->|"provides frames"| node_live
node_live -->|"reads student"| node_students
node_live -->|"sends alerts"| node_mail
node_live -.->|"loads weights"| node_weights

click node_seed "https://github.com/0buloy/yolov8uniformdetection/blob/main/AddDatatoDatabase.py"
click node_encode "https://github.com/0buloy/yolov8uniformdetection/blob/main/EncodeGenerator.py"
click node_live "https://github.com/0buloy/yolov8uniformdetection/blob/main/final.py"
click node_weights "https://github.com/0buloy/yolov8uniformdetection/blob/main/v8.pt"

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_seed,node_encode toneBlue
class node_live,node_weights toneAmber
class node_students,node_storage,node_camera,node_mail toneMint
class node_operator toneIndigo
```

## Components

### Student Setup

- [Seed Student Records](https://github.com/0buloy/yolov8uniformdetection/blob/main/AddDatatoDatabase.py): `AddDatatoDatabase.py`
- [Build Face Encodings](https://github.com/0buloy/yolov8uniformdetection/blob/main/EncodeGenerator.py): `EncodeGenerator.py`

### Live Screening

- [Recognize and Screen](https://github.com/0buloy/yolov8uniformdetection/blob/main/final.py): `final.py`
- [Detection Weights](https://github.com/0buloy/yolov8uniformdetection/blob/main/v8.pt): `v8.pt`

### External Services

- **Firebase Students**
- **Firebase Image Storage**
- **Webcam**
- **SMTP Email**

### Other components

- **Operator**

## Connections

- Operator → Seed Student Records: seeds records (evidence: `AddDatatoDatabase.py`)
- Seed Student Records → Firebase Students: writes records (evidence: `AddDatatoDatabase.py`)
- Operator → Build Face Encodings: prepares images (evidence: `EncodeGenerator.py`)
- Build Face Encodings → Firebase Image Storage: uploads images (evidence: `EncodeGenerator.py`)
- Operator → Recognize and Screen: starts checker (evidence: `final.py`)
- Webcam → Recognize and Screen: provides frames (evidence: `final.py`)
- Recognize and Screen → Firebase Students: reads student (evidence: `final.py`)
- Recognize and Screen → SMTP Email: sends alerts (evidence: `final.py`)
- Recognize and Screen → Detection Weights: loads weights
