# kmhmubin/face-recognition-attendance-system architecture

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

- Interactive diagram: https://gitdiagram.com/kmhmubin/face-recognition-attendance-system
- Repository: https://github.com/kmhmubin/face-recognition-attendance-system

## Overview

FRAS is a command-line face-recognition attendance application. Its main menu dispatches camera checking, face capture, model training, attendance recognition, and email reporting. Capture and training manage face samples and a persisted LBPH model; recognition consults student records and produces attendance CSVs. The Raspberry Pi scripts form a separate camera-based variant. Edges reflect calls and file operations shown in excerpts or capabilities documented in the README; absent sample-directory details are left unconnected.

Main entry points: [`FRAS/main.py`](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/main.py) (Main menu), [`FRAS/Recognize.py`](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Recognize.py) (Attendance recognition), [`FRAS/Capture_Image.py`](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Capture_Image.py) (Face capture), [`FRAS/Train_Image.py`](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Train_Image.py) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["FRAS application"]
  node_menu["Main menu<br/>[main.py]"]
  node_camera_check["Camera check<br/>[check_camera.py]"]
  node_face_capture["Face capture<br/>[Capture_Image.py]"]
  node_email_report["Email report<br/>[automail.py]"]
end

subgraph group_recognition["Face recognition"]
  node_face_training["Model training<br/>[Train_Image.py]"]
  node_face_recognition["Attendance recognition<br/>[Recognize.py]"]
  node_cascade["Haar cascade"]
  node_samples["Training samples"]
  node_model["LBPH model<br/>[Trainner.yml]"]
end

subgraph group_records["Attendance records"]
  node_student_records[("Student records<br/>[StudentDetails.csv]")]
  node_attendance[("Attendance CSVs")]
end

subgraph group_raspberry["Raspberry Pi variant"]
  node_pi_dataset["Pi face capture<br/>[Dataset.py]"]
  node_pi_attendance["Pi recognition and logging<br/>[Main.py]"]
end

node_user(("Operator"))
node_email_service["Email service"]
node_camera(("Camera"))
node_pi_camera(("Pi camera"))

node_user -->|"selects action"| node_menu
node_menu -->|"runs check"| node_camera_check
node_menu -->|"runs capture"| node_face_capture
node_menu -->|"runs training"| node_face_training
node_menu -->|"runs recognition"| node_face_recognition
node_menu -->|"runs mailer"| node_email_report
node_camera_check -->|"reads frames"| node_camera
node_face_capture -->|"reads frames"| node_camera
node_face_capture -->|"writes samples"| node_samples
node_face_capture -->|"appends student"| node_student_records
node_face_training -->|"loads samples"| node_samples
node_face_training -->|"saves model"| node_model
node_face_training -->|"loads cascade"| node_cascade
node_face_recognition -->|"reads frames"| node_camera
node_face_recognition -->|"loads cascade"| node_cascade
node_face_recognition -->|"loads model"| node_model
node_face_recognition -->|"looks up names"| node_student_records
node_face_recognition -->|"writes attendance"| node_attendance
node_email_report -->|"selects latest file"| node_attendance
node_email_report -->|"sends report"| node_email_service
node_pi_dataset -->|"reads frames"| node_pi_camera
node_pi_attendance -->|"reads frames"| node_pi_camera

click node_menu "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/main.py"
click node_camera_check "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/check_camera.py"
click node_face_capture "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Capture_Image.py"
click node_face_training "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Train_Image.py"
click node_face_recognition "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Recognize.py"
click node_cascade "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/haarcascade_frontalface_default.xml"
click node_model "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/TrainingImageLabel/Trainner.yml"
click node_student_records "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/StudentDetails/StudentDetails.csv"
click node_attendance "https://github.com/kmhmubin/face-recognition-attendance-system/tree/master/FRAS/Attendance"
click node_email_report "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/automail.py"
click node_pi_dataset "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/Raspberry%20Pi%20files/Dataset.py"
click node_pi_attendance "https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/Raspberry%20Pi%20files/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_menu,node_camera_check,node_face_capture,node_email_report toneBlue
class node_face_training,node_face_recognition,node_cascade,node_samples,node_model toneAmber
class node_student_records,node_attendance toneMint
class node_pi_dataset,node_pi_attendance toneRose
class node_user,node_email_service,node_camera,node_pi_camera toneIndigo
```

## Components

### FRAS application

- [Main menu](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/main.py): `FRAS/main.py`
- [Camera check](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/check_camera.py): `FRAS/check_camera.py`
- [Face capture](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Capture_Image.py): `FRAS/Capture_Image.py`
- [Email report](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/automail.py): `FRAS/automail.py`

### Face recognition

- [Model training](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Train_Image.py): `FRAS/Train_Image.py`
- [Attendance recognition](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/Recognize.py): `FRAS/Recognize.py`
- [Haar cascade](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/haarcascade_frontalface_default.xml): `FRAS/haarcascade_frontalface_default.xml`
- **Training samples**
- [LBPH model](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/TrainingImageLabel/Trainner.yml): `FRAS/TrainingImageLabel/Trainner.yml`

### Attendance records

- [Student records](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/FRAS/StudentDetails/StudentDetails.csv): `FRAS/StudentDetails/StudentDetails.csv`
- [Attendance CSVs](https://github.com/kmhmubin/face-recognition-attendance-system/tree/master/FRAS/Attendance): `FRAS/Attendance`

### Raspberry Pi variant

- [Pi face capture](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/Raspberry%20Pi%20files/Dataset.py): `Raspberry Pi files/Dataset.py`
- [Pi recognition and logging](https://github.com/kmhmubin/face-recognition-attendance-system/blob/master/Raspberry%20Pi%20files/Main.py): `Raspberry Pi files/Main.py`

### Other components

- **Operator**
- **Email service**
- **Camera**
- **Pi camera**

## Connections

- Operator → Main menu: selects action (evidence: `FRAS/main.py`)
- Main menu → Camera check: runs check (evidence: `FRAS/main.py`)
- Main menu → Face capture: runs capture (evidence: `FRAS/main.py`)
- Main menu → Model training: runs training (evidence: `FRAS/main.py`)
- Main menu → Attendance recognition: runs recognition (evidence: `FRAS/main.py`)
- Main menu → Email report: runs mailer (evidence: `FRAS/main.py`)
- Camera check → Camera: reads frames (evidence: `FRAS/check_camera.py`)
- Face capture → Camera: reads frames (evidence: `FRAS/Capture_Image.py`)
- Face capture → Training samples: writes samples (evidence: `FRAS/Capture_Image.py`)
- Face capture → Student records: appends student (evidence: `FRAS/Capture_Image.py`)
- Model training → Training samples: loads samples (evidence: `FRAS/Train_Image.py`)
- Model training → LBPH model: saves model (evidence: `FRAS/Train_Image.py`)
- Model training → Haar cascade: loads cascade (evidence: `FRAS/Train_Image.py`)
- Attendance recognition → Camera: reads frames (evidence: `FRAS/Recognize.py`)
- Attendance recognition → Haar cascade: loads cascade (evidence: `FRAS/Recognize.py`)
- Attendance recognition → LBPH model: loads model (evidence: `FRAS/Recognize.py`)
- Attendance recognition → Student records: looks up names (evidence: `FRAS/Recognize.py`)
- Attendance recognition → Attendance CSVs: writes attendance (evidence: `FRAS/Recognize.py`)
- Email report → Attendance CSVs: selects latest file (evidence: `FRAS/automail.py`)
- Email report → Email service: sends report (evidence: `FRAS/automail.py`)
- Pi face capture → Pi camera: reads frames (evidence: `Raspberry Pi files/Dataset.py`)
- Pi recognition and logging → Pi camera: reads frames (evidence: `Raspberry Pi files/Main.py`)
