# qver3nc1a/eigenfaces architecture

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

- Interactive diagram: https://gitdiagram.com/qver3nc1a/eigenfaces
- Repository: https://github.com/qver3nc1a/eigenfaces

## Overview

Eigenfaces is a face-recognition program: it prepares Olivetti face images, loads and splits them into training and validation sets, computes an eigenface representation, classifies validation faces by nearest neighbor, and reports accuracy. The PCA workflow is implemented in one module, while Jacobi eigen-decomposition is a separate numerical component. The graph follows the sampled source; documentation beyond the README was not inspected, so details of the user guide are not inferred.

Main entry points: [`src/pca.py`](https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py) (PCA workflow), [`data/load_olivetti.py`](https://github.com/qver3nc1a/eigenfaces/blob/main/data/load_olivetti.py) (Dataset fetcher), [`src/dataset.py`](https://github.com/qver3nc1a/eigenfaces/blob/main/src/dataset.py) (Split and preprocess), [`data`](https://github.com/qver3nc1a/eigenfaces/tree/main/data) (Face image files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Face data"]
  node_fetcher["Dataset fetcher<br/>[load_olivetti.py]"]
  node_face_files[("Face image files")]
  node_loader["Split and preprocess<br/>[dataset.py]"]
end

subgraph group_recognition["Recognition workflow"]
  node_pca["PCA workflow<br/>[pca.py]"]
  node_center["Mean centering<br/>[pca.py]"]
  node_eigenfaces["Eigenface basis<br/>[pca.py]"]
  node_projection["Face projection<br/>[pca.py]"]
  node_classifier["Nearest neighbor<br/>[pca.py]"]
  node_evaluation["Accuracy report<br/>[pca.py]"]
end

subgraph group_numerics["Numerical methods"]
  node_jacobi["Jacobi eigensolver<br/>[jacobi.py]"]
end

node_user(("User"))
node_olivetti[("Olivetti dataset")]

node_user -.->|"runs"| node_pca
node_fetcher -->|"fetches"| node_olivetti
node_fetcher -->|"writes images"| node_face_files
node_loader -->|"reads images"| node_face_files
node_pca -->|"loads splits"| node_loader
node_pca -->|"centers training faces"| node_center
node_pca -->|"builds basis"| node_eigenfaces
node_pca -->|"decomposes covariance"| node_jacobi
node_pca -->|"projects faces"| node_projection
node_pca -->|"predicts labels"| node_classifier
node_pca -->|"computes accuracy"| node_evaluation

click node_fetcher "https://github.com/qver3nc1a/eigenfaces/blob/main/data/load_olivetti.py"
click node_face_files "https://github.com/qver3nc1a/eigenfaces/tree/main/data"
click node_loader "https://github.com/qver3nc1a/eigenfaces/blob/main/src/dataset.py"
click node_pca "https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py"
click node_center "https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py"
click node_eigenfaces "https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py"
click node_projection "https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py"
click node_classifier "https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py"
click node_evaluation "https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py"
click node_jacobi "https://github.com/qver3nc1a/eigenfaces/blob/main/src/jacobi.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_fetcher,node_face_files,node_loader,node_user toneBlue
class node_pca,node_center,node_eigenfaces,node_projection,node_classifier,node_evaluation,node_olivetti toneAmber
class node_jacobi toneMint
```

## Components

### Face data

- [Dataset fetcher](https://github.com/qver3nc1a/eigenfaces/blob/main/data/load_olivetti.py): `data/load_olivetti.py`
- [Face image files](https://github.com/qver3nc1a/eigenfaces/tree/main/data): `data`
- [Split and preprocess](https://github.com/qver3nc1a/eigenfaces/blob/main/src/dataset.py): `src/dataset.py`

### Recognition workflow

- [PCA workflow](https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py): `src/pca.py`
- [Mean centering](https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py): `src/pca.py`
- [Eigenface basis](https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py): `src/pca.py`
- [Face projection](https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py): `src/pca.py`
- [Nearest neighbor](https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py): `src/pca.py`
- [Accuracy report](https://github.com/qver3nc1a/eigenfaces/blob/main/src/pca.py): `src/pca.py`

### Numerical methods

- [Jacobi eigensolver](https://github.com/qver3nc1a/eigenfaces/blob/main/src/jacobi.py): `src/jacobi.py`

### Other components

- **User**
- **Olivetti dataset**

## Connections

- User → PCA workflow: runs (evidence: `README.md`)
- Dataset fetcher → Olivetti dataset: fetches (evidence: `data/load_olivetti.py`)
- Dataset fetcher → Face image files: writes images (evidence: `data/load_olivetti.py`)
- Split and preprocess → Face image files: reads images (evidence: `src/dataset.py`)
- PCA workflow → Split and preprocess: loads splits (evidence: `src/pca.py`)
- PCA workflow → Mean centering: centers training faces (evidence: `src/pca.py`)
- PCA workflow → Eigenface basis: builds basis (evidence: `src/pca.py`)
- PCA workflow → Jacobi eigensolver: decomposes covariance (evidence: `src/pca.py`)
- PCA workflow → Face projection: projects faces (evidence: `src/pca.py`)
- PCA workflow → Nearest neighbor: predicts labels (evidence: `src/pca.py`)
- PCA workflow → Accuracy report: computes accuracy (evidence: `src/pca.py`)
