# praveen-asml24026/face-recognition-attendance architecture

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

- Interactive diagram: https://gitdiagram.com/praveen-asml24026/face-recognition-attendance
- Repository: https://github.com/praveen-asml24026/face-recognition-attendance

## Overview

A small, single-file webcam attendance application. It loads named reference images, computes face encodings, then repeatedly captures and downscales webcam frames, detects and matches faces, displays recognized names, and records each person once in a CSV. All runtime responsibilities are implemented in main.py; the README documents the image folder and CSV as inputs and output. The documented workflow is supported, but internal steps share one source file, so edges cite that file rather than implying separate modules.

Main entry points: [`main.py`](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py) (Face matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_recognition["Recognition workflow"]
  node_reference_images[("Reference images")]
  node_image_loader["Image loader<br/>[main.py]"]
  node_known_encodings["Known encodings<br/>[main.py]"]
  node_webcam["Webcam"]
  node_frame_processing["Frame processing<br/>[main.py]"]
  node_face_detection["Face detection<br/>[main.py]"]
  node_face_matching["Face matching<br/>[main.py]"]
  node_visual_feedback["Visual feedback<br/>[main.py]"]
end

subgraph group_attendance["Attendance output"]
  node_attendance_guard["Duplicate prevention<br/>[main.py]"]
  node_timestamp["Timestamp generation<br/>[main.py]"]
  node_attendance_csv[("Attendance CSV")]
end

node_operator(("Operator"))

node_operator -->|"provides images"| node_image_loader
node_reference_images -->|"loads images"| node_image_loader
node_image_loader -->|"encodes faces"| node_known_encodings
node_operator -->|"starts capture"| node_webcam
node_webcam -->|"streams frames"| node_frame_processing
node_frame_processing -->|"detects faces"| node_face_detection
node_face_detection -->|"encodes locations"| node_face_matching
node_known_encodings -->|"compares faces"| node_face_matching
node_face_matching -->|"renders match"| node_visual_feedback
node_face_matching -->|"logs match"| node_attendance_guard
node_attendance_guard -->|"reads and writes"| node_attendance_csv
node_attendance_guard -->|"requests time"| node_timestamp
node_timestamp -->|"returns time"| node_attendance_guard

click node_image_loader "https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py"
click node_known_encodings "https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py"
click node_frame_processing "https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py"
click node_face_detection "https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py"
click node_face_matching "https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py"
click node_visual_feedback "https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py"
click node_attendance_guard "https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py"
click node_timestamp "https://github.com/praveen-asml24026/face-recognition-attendance/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_reference_images,node_image_loader,node_known_encodings,node_webcam,node_frame_processing,node_face_detection,node_face_matching,node_visual_feedback toneBlue
class node_attendance_guard,node_timestamp,node_attendance_csv toneAmber
class node_operator toneIndigo
```

## Components

### Recognition workflow

- **Reference images**
- [Image loader](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py): `main.py`
- [Known encodings](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py): `main.py`
- **Webcam**
- [Frame processing](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py): `main.py`
- [Face detection](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py): `main.py`
- [Face matching](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py): `main.py`
- [Visual feedback](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py): `main.py`

### Attendance output

- [Duplicate prevention](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py): `main.py`
- [Timestamp generation](https://github.com/praveen-asml24026/face-recognition-attendance/blob/main/main.py): `main.py`
- **Attendance CSV**

### Other components

- **Operator**

## Connections

- Operator → Image loader: provides images (evidence: `README.md`)
- Reference images → Image loader: loads images (evidence: `README.md`)
- Image loader → Known encodings: encodes faces (evidence: `main.py`)
- Operator → Webcam: starts capture (evidence: `README.md`)
- Webcam → Frame processing: streams frames (evidence: `main.py`)
- Frame processing → Face detection: detects faces (evidence: `main.py`)
- Face detection → Face matching: encodes locations (evidence: `main.py`)
- Known encodings → Face matching: compares faces (evidence: `main.py`)
- Face matching → Visual feedback: renders match (evidence: `main.py`)
- Face matching → Duplicate prevention: logs match (evidence: `main.py`)
- Duplicate prevention → Attendance CSV: reads and writes (evidence: `main.py`)
- Duplicate prevention → Timestamp generation: requests time (evidence: `main.py`)
- Timestamp generation → Duplicate prevention: returns time (evidence: `main.py`)
