# valeskarosario10/facestamp architecture

> Architecture diagram of the GitHub repository valeskarosario10/facestamp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/valeskarosario10/facestamp
- Repository: https://github.com/valeskarosario10/facestamp

## Overview

##### Project type and purpose
- FaceStamp is a local GUI-based Python application for automating attendance via face recognition.
- It uses OpenCV’s Haar Cascade for detection and an LBPH-style model for recognition, with datasets stored as images and attendance records in CSV.

##### File structure
- All major files live at the root (no separate “src” or “backend” directories).
- GUI entry points: Main.py, pg1.py, exit.py
- Data-collection & model training: Photos.py, tp.py
- Attendance operations: takeAtt.py (record), checkAtt.py (view), att.csv (stores records)
- Student management: student.py (handle student metadata)
- Resources: haarcascade_frontalface_default.xml (detector model)
- Dependencies are declared in README (tkinter, cv2, numpy, PIL, pandas).

##### README for additional insight
- Confirms methodology: image preprocessing → face detection → recognition → attendance logging.
- No external services—entirely local.

##### Detail
- Flows (e.g., “Frame → Haar Cascade → Candidates → Recognizer”).

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Presentation Layer"
        Main["Main.py"]:::ui
        Pg1["pg1.py"]:::ui
        Exit["exit.py"]:::ui
    end

    subgraph "Processing: Detection & Recognition"
        Photos["Photos.py"]:::processing
        Train["tp.py"]:::processing
        Haar["haarcascade_frontalface_default.xml"]:::processing
    end

    subgraph "Processing: Attendance Module"
        Take["takeAtt.py"]:::processing
        Check["checkAtt.py"]:::processing
        Student["student.py"]:::processing
    end

    subgraph "Storage"
        Dataset["Image Dataset Folder"]:::storage
        CSV["att.csv"]:::storage
    end

    subgraph "External Libraries"
        Libs["tkinter, cv2, numpy, PIL, pandas"]:::external
    end

    Main --> Pg1
    Pg1 --> Photos
    Pg1 --> Take
    Pg1 --> Check
    Pg1 --> Exit

    Photos --> Dataset
    Photos --> Train
    Train --> Haar

    Take --> Haar
    Take --> Student
    Take --> CSV

    Check --> CSV
    Check --> Pg1

    Libs -.-> Main
    Libs -.-> Pg1
    Libs -.-> Exit
    Libs -.-> Photos
    Libs -.-> Train
    Libs -.-> Take
    Libs -.-> Check
    Libs -.-> Student

    click Main "https://github.com/valeskarosario10/facestamp/blob/main/Main.py"
    click Pg1 "https://github.com/valeskarosario10/facestamp/blob/main/pg1.py"
    click Exit "https://github.com/valeskarosario10/facestamp/blob/main/exit.py"
    click Photos "https://github.com/valeskarosario10/facestamp/blob/main/Photos.py"
    click Train "https://github.com/valeskarosario10/facestamp/blob/main/tp.py"
    click Haar "https://github.com/valeskarosario10/facestamp/blob/main/haarcascade_frontalface_default.xml"
    click Take "https://github.com/valeskarosario10/facestamp/blob/main/takeAtt.py"
    click Check "https://github.com/valeskarosario10/facestamp/blob/main/checkAtt.py"
    click CSV "https://github.com/valeskarosario10/facestamp/blob/main/att.csv"
    click Student "https://github.com/valeskarosario10/facestamp/blob/main/student.py"

    classDef ui fill:#bbdefb,stroke:#333,stroke-width:1px
    classDef processing fill:#c8e6c9,stroke:#333,stroke-width:1px
    classDef storage fill:#ffe0b2,stroke:#333,stroke-width:1px
    classDef external fill:#eeeeee,stroke:#666,stroke-dasharray: 2 2,stroke-width:1px
```
