# sumanxhub/presensee architecture

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

- Interactive diagram: https://gitdiagram.com/sumanxhub/presensee
- Repository: https://github.com/sumanxhub/presensee

## Overview

PresenSee is a webcam-based attendance application. A user registers face samples, trains an LBPH model, then runs recognition to log each recognized person once per day; attendance CSVs can be exported to Excel. The GUI launches these workflows as separate scripts. Recognition, training, and export behavior is supported by sampled source; the README documents the overall capabilities. The generated trainer file is not present in the supplied tree, so its node uses the enclosing models directory.

Main entry points: [`src/core/face_recognition.py`](https://github.com/sumanxhub/presensee/blob/main/src/core/face_recognition.py) (Face recognition), [`gui.py`](https://github.com/sumanxhub/presensee/blob/main/gui.py) (PresenSee GUI), [`src/core/face_register.py`](https://github.com/sumanxhub/presensee/blob/main/src/core/face_register.py) (Face registration), [`src/core/face_trainer.py`](https://github.com/sumanxhub/presensee/blob/main/src/core/face_trainer.py) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_gui["PresenSee GUI<br/>[gui.py]"]
end

subgraph group_face["Face workflows"]
  node_register["Face registration<br/>[face_register.py]"]
  node_cascade["Haar cascade"]
  node_dataset[("User face samples")]
  node_trainer["Model training<br/>[face_trainer.py]"]
  node_model["LBPH model"]
end

subgraph group_attendance["Attendance records"]
  node_recognition["Face recognition"]
  node_attendance[("Daily CSV logs")]
end

subgraph group_export["Reporting"]
  node_converter["CSV to Excel<br/>[convertToExcel.py]"]
  node_workbooks[("Excel exports")]
end

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

node_user -->|"uses"| node_gui
node_gui -->|"launches"| node_register
node_gui -->|"launches"| node_trainer
node_gui -->|"launches"| node_recognition
node_gui -->|"launches"| node_converter
node_register -->|"captures from"| node_camera
node_register -->|"detects with"| node_cascade
node_register -->|"writes samples"| node_dataset
node_trainer -->|"reads samples"| node_dataset
node_trainer -->|"writes model"| node_model
node_recognition -->|"captures from"| node_camera
node_recognition -->|"detects with"| node_cascade
node_recognition -->|"loads model"| node_model
node_recognition -->|"loads user names"| node_dataset
node_recognition -->|"writes daily logs"| node_attendance
node_converter -->|"reads today's CSV"| node_attendance
node_converter -->|"writes workbook"| node_workbooks

click node_gui "https://github.com/sumanxhub/presensee/blob/main/gui.py"
click node_register "https://github.com/sumanxhub/presensee/blob/main/src/core/face_register.py"
click node_cascade "https://github.com/sumanxhub/presensee/blob/main/models/haarcascade_frontalface_default.xml"
click node_dataset "https://github.com/sumanxhub/presensee/tree/main/dataset/users"
click node_trainer "https://github.com/sumanxhub/presensee/blob/main/src/core/face_trainer.py"
click node_model "https://github.com/sumanxhub/presensee/tree/main/models"
click node_recognition "https://github.com/sumanxhub/presensee/blob/main/src/core/face_recognition.py"
click node_attendance "https://github.com/sumanxhub/presensee/tree/main/attendance"
click node_converter "https://github.com/sumanxhub/presensee/blob/main/src/core/convertToExcel.py"
click node_workbooks "https://github.com/sumanxhub/presensee/tree/main/database"

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_gui toneBlue
class node_register,node_cascade,node_dataset,node_trainer,node_model toneAmber
class node_recognition,node_attendance toneMint
class node_converter,node_workbooks toneRose
class node_user,node_camera toneIndigo
```

## Components

### User interface

- [PresenSee GUI](https://github.com/sumanxhub/presensee/blob/main/gui.py): `gui.py`

### Face workflows

- [Face registration](https://github.com/sumanxhub/presensee/blob/main/src/core/face_register.py): `src/core/face_register.py`
- [Haar cascade](https://github.com/sumanxhub/presensee/blob/main/models/haarcascade_frontalface_default.xml): `models/haarcascade_frontalface_default.xml`
- [User face samples](https://github.com/sumanxhub/presensee/tree/main/dataset/users): `dataset/users`
- [Model training](https://github.com/sumanxhub/presensee/blob/main/src/core/face_trainer.py): `src/core/face_trainer.py`
- [LBPH model](https://github.com/sumanxhub/presensee/tree/main/models): `models`

### Attendance records

- [Face recognition](https://github.com/sumanxhub/presensee/blob/main/src/core/face_recognition.py): `src/core/face_recognition.py`
- [Daily CSV logs](https://github.com/sumanxhub/presensee/tree/main/attendance): `attendance`

### Reporting

- [CSV to Excel](https://github.com/sumanxhub/presensee/blob/main/src/core/convertToExcel.py): `src/core/convertToExcel.py`
- [Excel exports](https://github.com/sumanxhub/presensee/tree/main/database): `database`

### Other components

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

## Connections

- Operator → PresenSee GUI: uses
- PresenSee GUI → Face registration: launches
- PresenSee GUI → Model training: launches
- PresenSee GUI → Face recognition: launches
- PresenSee GUI → CSV to Excel: launches
- Face registration → Webcam: captures from
- Face registration → Haar cascade: detects with
- Face registration → User face samples: writes samples
- Model training → User face samples: reads samples
- Model training → LBPH model: writes model
- Face recognition → Webcam: captures from
- Face recognition → Haar cascade: detects with
- Face recognition → LBPH model: loads model
- Face recognition → User face samples: loads user names
- Face recognition → Daily CSV logs: writes daily logs
- CSV to Excel → Daily CSV logs: reads today's CSV
- CSV to Excel → Excel exports: writes workbook
