# khotchaitanya/ai-powered-eye-sensor-attendance-system architecture

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

- Interactive diagram: https://gitdiagram.com/khotchaitanya/ai-powered-eye-sensor-attendance-system
- Repository: https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system

## Overview

Smart Attendance is a desktop facial-recognition attendance application. Users launch the home screen, then choose enrollment or attendance: enrollment captures a webcam frame and sends it to the backend for face encoding and storage; attendance frames and landmarks go to the backend for identity matching, blink-based liveness verification, and attendance logging. The backend also exports attendance records to CSV. The principal call paths are visible in excerpts; other internal details are represented only where the README documents them.

Main entry points: [`main_gui.py`](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/main_gui.py) (Home screen), [`backend.py`](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py) (Verification workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_home["Home screen<br/>[main_gui.py]"]
  node_enroll_ui["Enrollment window<br/>[main_gui.py]"]
  node_attendance_ui["Attendance window<br/>[main_gui.py]"]
end

subgraph group_identity["Enrollment and identity"]
  node_system["Attendance system<br/>[backend.py]"]
  node_face_encode["Face encoding<br/>[backend.py]"]
  node_user_store[("User database<br/>[backend.py]")]
  node_known_users["Known-user loading<br/>[backend.py]"]
end

subgraph group_verification["Attendance verification"]
  node_face_match["Face matching<br/>[backend.py]"]
  node_liveness["Blink liveness<br/>[backend.py]"]
  node_workflow["Verification workflow<br/>[backend.py]"]
end

subgraph group_records["Attendance records"]
  node_attendance_log["Attendance logging<br/>[backend.py]"]
  node_attendance_file["Attendance CSV<br/>[backend.py]"]
  node_export["CSV export<br/>[backend.py]"]
end

node_user(("Operator"))
node_camera["Webcam"]

node_user -->|"opens"| node_home
node_home -->|"initializes"| node_system
node_home -.->|"opens"| node_enroll_ui
node_home -.->|"opens"| node_attendance_ui
node_camera -->|"supplies frames"| node_enroll_ui
node_enroll_ui -->|"submits frame"| node_system
node_system -->|"encodes face"| node_face_encode
node_face_encode -->|"stores identity"| node_user_store
node_system -->|"loads users"| node_user_store
node_user_store -->|"provides records"| node_known_users
node_camera -->|"supplies frames"| node_attendance_ui
node_attendance_ui -->|"submits frame and landmarks"| node_workflow
node_workflow -->|"matches identity"| node_face_match
node_face_match -->|"compares encodings"| node_known_users
node_workflow -->|"checks blink"| node_liveness
node_workflow -->|"logs verified user"| node_attendance_log
node_attendance_log -->|"appends record"| node_attendance_file
node_attendance_file -.->|"supplies records"| node_export

click node_home "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/main_gui.py"
click node_enroll_ui "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/main_gui.py"
click node_attendance_ui "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/main_gui.py"
click node_system "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_face_encode "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_user_store "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_known_users "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_face_match "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_liveness "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_workflow "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_attendance_log "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_attendance_file "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py"
click node_export "https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.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_home,node_enroll_ui,node_attendance_ui toneBlue
class node_system,node_face_encode,node_user_store,node_known_users toneAmber
class node_face_match,node_liveness,node_workflow toneMint
class node_attendance_log,node_attendance_file,node_export toneRose
class node_user,node_camera toneIndigo
```

## Components

### Desktop interface

- [Home screen](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/main_gui.py): `main_gui.py`
- [Enrollment window](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/main_gui.py): `main_gui.py`
- [Attendance window](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/main_gui.py): `main_gui.py`

### Enrollment and identity

- [Attendance system](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`
- [Face encoding](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`
- [User database](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`
- [Known-user loading](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`

### Attendance verification

- [Face matching](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`
- [Blink liveness](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`
- [Verification workflow](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`

### Attendance records

- [Attendance logging](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`
- [Attendance CSV](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`
- [CSV export](https://github.com/khotchaitanya/ai-powered-eye-sensor-attendance-system/blob/main/backend.py): `backend.py`

### Other components

- **Operator**
- **Webcam**

## Connections

- Operator → Home screen: opens (evidence: `README.md`)
- Home screen → Attendance system: initializes (evidence: `main_gui.py`)
- Home screen → Enrollment window: opens (evidence: `main_gui.py`)
- Home screen → Attendance window: opens (evidence: `main_gui.py`)
- Webcam → Enrollment window: supplies frames (evidence: `README.md`)
- Enrollment window → Attendance system: submits frame (evidence: `main_gui.py`)
- Attendance system → Face encoding: encodes face (evidence: `backend.py`)
- Face encoding → User database: stores identity (evidence: `backend.py`)
- Attendance system → User database: loads users (evidence: `backend.py`)
- User database → Known-user loading: provides records (evidence: `backend.py`)
- Webcam → Attendance window: supplies frames (evidence: `README.md`)
- Attendance window → Verification workflow: submits frame and landmarks (evidence: `main_gui.py`)
- Verification workflow → Face matching: matches identity (evidence: `backend.py`)
- Face matching → Known-user loading: compares encodings (evidence: `backend.py`)
- Verification workflow → Blink liveness: checks blink (evidence: `backend.py`)
- Verification workflow → Attendance logging: logs verified user (evidence: `backend.py`)
- Attendance logging → Attendance CSV: appends record (evidence: `backend.py`)
- Attendance CSV → CSV export: supplies records (evidence: `backend.py`)
