# rishabh-karmakar/facial-recognition-based-attendance-system architecture

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

- Interactive diagram: https://gitdiagram.com/rishabh-karmakar/facial-recognition-based-attendance-system
- Repository: https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system

## Overview

This repository is a desktop facial-recognition attendance application. Its intended workflow is login, facial verification, student registration, camera-based recognition, and attendance recording; the README also documents a two-step admin check. The sampled login screen does not actually invoke the separate `Auth.py` flow, so that connection is not shown. Registration and attendance processing are separate camera workflows. The graph includes the shared detection, alignment, and feature-extraction layer; the attendance-view implementation is not present in the supplied tree.

Main entry points: [`Recog.py`](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Recog.py) (Attendance Capture), [`Auth.py`](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Auth.py) (Face Verification), [`Add_New.py`](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Add_New.py) (Student Registration), [`screen.py`](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/screen.py) (Main Menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and UI"]
  node_login["Login Screen<br/>[main.py]"]
  node_login_db[("Login Database<br/>[facedb.db]")]
  node_admin_auth["Face Verification<br/>[Auth.py]"]
  node_success_screen["Success Screen<br/>[auth1.py]"]
  node_menu["Main Menu<br/>[screen.py]"]
  node_admin_names["Admin Name Map<br/>[names.txt]"]
  node_admin_features["Admin Features<br/>[master.txt]"]
end

subgraph group_recognition["Face Recognition"]
  node_detector["MTCNN Detector<br/>[mtcnn_detect.py]"]
  node_aligner["Face Alignment<br/>[align_custom.py]"]
  node_feature["Feature Extractor<br/>[face_feature.py]"]
  node_graph["Model Graph<br/>[tf_graph.py]"]
  node_model["Face Model"]
end

subgraph group_students["Student Registry"]
  node_register["Student Registration<br/>[Add_New.py]"]
  node_feature_store["Face Features<br/>[facerec_128D.txt]"]
  node_class_sheet["Class Roster<br/>[Class.xlsx]"]
  node_name_map["Student Names<br/>[names.txt]"]
end

subgraph group_attendance["Attendance"]
  node_attendance_run["Attendance Capture<br/>[Recog.py]"]
  node_attendance_sheet["Attendance Workbook<br/>[Attendance.xlsx]"]
end

node_user(("Operator"))
node_camera(("Camera"))

node_user -->|"enters credentials"| node_login
node_login -->|"checks credentials"| node_login_db
node_user -.->|"starts verification"| node_admin_auth
node_admin_auth -->|"captures frames"| node_camera
node_admin_auth -->|"detects faces"| node_detector
node_admin_auth -->|"aligns faces"| node_aligner
node_admin_auth -->|"extracts features"| node_feature
node_admin_auth -->|"reads templates"| node_admin_features
node_admin_auth -->|"checks identity"| node_admin_names
node_admin_auth -->|"launches on match"| node_success_screen
node_success_screen -->|"opens menu"| node_menu
node_user -->|"selects action"| node_menu
node_menu -->|"launches registration"| node_register
node_menu -->|"launches attendance"| node_attendance_run
node_register -->|"captures faces"| node_camera
node_register -->|"detects faces"| node_detector
node_register -->|"aligns faces"| node_aligner
node_register -->|"extracts features"| node_feature
node_feature -->|"uses graph"| node_graph
node_graph -->|"builds network"| node_model
node_register -->|"writes templates"| node_feature_store
node_register -->|"updates roster"| node_class_sheet
node_register -->|"updates names"| node_name_map
node_attendance_run -->|"captures frames"| node_camera
node_attendance_run -->|"detects faces"| node_detector
node_attendance_run -->|"aligns faces"| node_aligner
node_attendance_run -->|"extracts features"| node_feature
node_attendance_run -->|"reads templates"| node_feature_store
node_attendance_run -->|"reads names"| node_name_map
node_attendance_run -->|"copies roster"| node_class_sheet
node_attendance_run -->|"marks attendance"| node_attendance_sheet

click node_login "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/main.py"
click node_login_db "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/facedb.db"
click node_admin_auth "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Auth.py"
click node_success_screen "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/auth1.py"
click node_menu "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/screen.py"
click node_detector "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/mtcnn_detect.py"
click node_aligner "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/align_custom.py"
click node_feature "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/face_feature.py"
click node_graph "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/tf_graph.py"
click node_model "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/architecture/inception_resnet_v1.py"
click node_register "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Add_New.py"
click node_feature_store "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/facerec_128D.txt"
click node_class_sheet "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Class.xlsx"
click node_name_map "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/names.txt"
click node_attendance_run "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Recog.py"
click node_attendance_sheet "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Attendance.xlsx"
click node_admin_names "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/names.txt"
click node_admin_features "https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/master.txt"

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_login,node_login_db,node_admin_auth,node_success_screen,node_menu,node_admin_names,node_admin_features toneBlue
class node_detector,node_aligner,node_feature,node_graph,node_model toneAmber
class node_register,node_feature_store,node_class_sheet,node_name_map toneMint
class node_attendance_run,node_attendance_sheet toneRose
class node_user,node_camera toneIndigo
```

## Components

### Access and UI

- [Login Screen](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/main.py): `main.py`
- [Login Database](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/facedb.db): `facedb.db`
- [Face Verification](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Auth.py): `Auth.py`
- [Success Screen](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/auth1.py): `auth1.py`
- [Main Menu](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/screen.py): `screen.py`
- [Admin Name Map](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/names.txt): `names.txt`
- [Admin Features](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/master.txt): `master.txt`

### Face Recognition

- [MTCNN Detector](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/mtcnn_detect.py): `mtcnn_detect.py`
- [Face Alignment](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/align_custom.py): `align_custom.py`
- [Feature Extractor](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/face_feature.py): `face_feature.py`
- [Model Graph](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/tf_graph.py): `tf_graph.py`
- [Face Model](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/architecture/inception_resnet_v1.py): `architecture/inception_resnet_v1.py`

### Student Registry

- [Student Registration](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Add_New.py): `Add_New.py`
- [Face Features](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/facerec_128D.txt): `facerec_128D.txt`
- [Class Roster](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Class.xlsx): `Class.xlsx`
- [Student Names](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/names.txt): `names.txt`

### Attendance

- [Attendance Capture](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Recog.py): `Recog.py`
- [Attendance Workbook](https://github.com/rishabh-karmakar/facial-recognition-based-attendance-system/blob/master/Attendance.xlsx): `Attendance.xlsx`

### Other components

- **Operator**
- **Camera**

## Connections

- Operator → Login Screen: enters credentials
- Login Screen → Login Database: checks credentials
- Operator → Face Verification: starts verification
- Face Verification → Camera: captures frames
- Face Verification → MTCNN Detector: detects faces
- Face Verification → Face Alignment: aligns faces
- Face Verification → Feature Extractor: extracts features
- Face Verification → Admin Features: reads templates
- Face Verification → Admin Name Map: checks identity
- Face Verification → Success Screen: launches on match
- Success Screen → Main Menu: opens menu
- Operator → Main Menu: selects action
- Main Menu → Student Registration: launches registration
- Main Menu → Attendance Capture: launches attendance
- Student Registration → Camera: captures faces
- Student Registration → MTCNN Detector: detects faces
- Student Registration → Face Alignment: aligns faces
- Student Registration → Feature Extractor: extracts features
- Feature Extractor → Model Graph: uses graph
- Model Graph → Face Model: builds network
- Student Registration → Face Features: writes templates
- Student Registration → Class Roster: updates roster
- Student Registration → Student Names: updates names
- Attendance Capture → Camera: captures frames
- Attendance Capture → MTCNN Detector: detects faces
- Attendance Capture → Face Alignment: aligns faces
- Attendance Capture → Feature Extractor: extracts features
- Attendance Capture → Face Features: reads templates
- Attendance Capture → Student Names: reads names
- Attendance Capture → Class Roster: copies roster
- Attendance Capture → Attendance Workbook: marks attendance
