# 66pig/face_recognition architecture

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

- Interactive diagram: https://gitdiagram.com/66pig/face_recognition
- Repository: https://github.com/66pig/face_recognition

## Overview

This is a PyQt desktop face-recognition attendance application, launched with `python3 face.py`. Its main workflow is to load attendance configuration and user records, recognize people from camera frames, record successful check-ins, and display attendance information. The README also documents configurable refresh and sign-in interfaces, downloaded avatars and audio, and saved check-in captures. The graph combines sampled `face.py` behavior with those README-described capabilities; unsampled subsystem links are omitted where their runtime wiring is not shown.

Main entry points: [`face.py`](https://github.com/66pig/face_recognition/blob/master/face.py) (Attendance app), [`Ui_test_01.py`](https://github.com/66pig/face_recognition/blob/master/Ui_test_01.py) (Attendance UI), [`config`](https://github.com/66pig/face_recognition/blob/master/config) (Runtime settings), [`api`](https://github.com/66pig/face_recognition/blob/master/api) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop application"]
  node_main["Attendance app<br/>[face.py]"]
  node_window["Attendance UI<br/>[Ui_test_01.py]"]
end

subgraph group_recognition["Recognition and attendance"]
  node_recognizer["Face recognition<br/>[face.py]"]
  node_checkin["Check-in handling<br/>[face.py]"]
end

subgraph group_resources["Configuration and resources"]
  node_settings["Runtime settings"]
  node_userrecords["User records"]
  node_avatarfiles["Avatar files"]
  node_audiofiles["Audio files"]
end

subgraph group_records["Attendance records"]
  node_checkinarchive["Check-in captures"]
  node_signhistory["Sign-in history<br/>[face.py]"]
end

node_operator(("Operator"))
node_camera["Camera input"]
node_signservice["Sign-in service"]
node_configservice["Config service"]

node_operator -->|"launches"| node_main
node_main -->|"sets up"| node_window
node_main -->|"reads"| node_settings
node_main -->|"fetches settings"| node_configservice
node_main -->|"downloads records"| node_userrecords
node_main -.->|"submits check-ins"| node_signservice
node_main -->|"runs"| node_recognizer
node_camera -.->|"supplies frames"| node_recognizer
node_recognizer -->|"confirms identity"| node_checkin
node_checkin -->|"updates"| node_signhistory
node_checkin -->|"saves capture"| node_checkinarchive
node_main -->|"downloads avatars"| node_avatarfiles
node_main -->|"downloads audio"| node_audiofiles
node_main -.->|"updates display"| node_window

click node_main "https://github.com/66pig/face_recognition/blob/master/face.py"
click node_window "https://github.com/66pig/face_recognition/blob/master/Ui_test_01.py"
click node_recognizer "https://github.com/66pig/face_recognition/blob/master/face.py"
click node_checkin "https://github.com/66pig/face_recognition/blob/master/face.py"
click node_settings "https://github.com/66pig/face_recognition/blob/master/config"
click node_userrecords "https://github.com/66pig/face_recognition/blob/master/api"
click node_audiofiles "https://github.com/66pig/face_recognition/tree/master/audio"
click node_checkinarchive "https://github.com/66pig/face_recognition/tree/master/back"
click node_signhistory "https://github.com/66pig/face_recognition/blob/master/face.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_main,node_window toneBlue
class node_recognizer,node_checkin toneAmber
class node_settings,node_userrecords,node_avatarfiles,node_audiofiles toneMint
class node_checkinarchive,node_signhistory toneRose
class node_operator,node_camera,node_signservice,node_configservice toneIndigo
```

## Components

### Desktop application

- [Attendance app](https://github.com/66pig/face_recognition/blob/master/face.py): `face.py`
- [Attendance UI](https://github.com/66pig/face_recognition/blob/master/Ui_test_01.py): `Ui_test_01.py`

### Recognition and attendance

- [Face recognition](https://github.com/66pig/face_recognition/blob/master/face.py): `face.py`
- [Check-in handling](https://github.com/66pig/face_recognition/blob/master/face.py): `face.py`

### Configuration and resources

- [Runtime settings](https://github.com/66pig/face_recognition/blob/master/config): `config`
- [User records](https://github.com/66pig/face_recognition/blob/master/api): `api`
- **Avatar files**
- [Audio files](https://github.com/66pig/face_recognition/tree/master/audio): `audio`

### Attendance records

- [Check-in captures](https://github.com/66pig/face_recognition/tree/master/back): `back`
- [Sign-in history](https://github.com/66pig/face_recognition/blob/master/face.py): `face.py`

### Other components

- **Operator**
- **Camera input**
- **Sign-in service**
- **Config service**

## Connections

- Operator → Attendance app: launches (evidence: `README.md`)
- Attendance app → Attendance UI: sets up (evidence: `face.py`)
- Attendance app → Runtime settings: reads (evidence: `face.py`)
- Attendance app → Config service: fetches settings (evidence: `README.md`)
- Attendance app → User records: downloads records (evidence: `face.py`)
- Attendance app → Sign-in service: submits check-ins (evidence: `README.md`)
- Attendance app → Face recognition: runs (evidence: `face.py`)
- Camera input → Face recognition: supplies frames
- Face recognition → Check-in handling: confirms identity (evidence: `face.py`)
- Check-in handling → Sign-in history: updates (evidence: `face.py`)
- Check-in handling → Check-in captures: saves capture (evidence: `README.md`)
- Attendance app → Avatar files: downloads avatars (evidence: `README.md`)
- Attendance app → Audio files: downloads audio (evidence: `README.md`)
- Attendance app → Attendance UI: updates display (evidence: `face.py`)
