# 7drien/easyid architecture

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

- Interactive diagram: https://gitdiagram.com/7drien/easyid
- Repository: https://github.com/7drien/easyid

## Overview

EasyID turns a portrait supplied through the CLI, Python API, or desktop UI into a standards-sized, aligned identity photo, a compliance report, and optionally a print sheet. Its main processing path detects facial landmarks, segments the subject, crops and aligns the image, validates the result, and generates printable output. The README also documents webcam capture and image overlays. Some module relationships are visible only through the source index or README; the graph avoids inferring unshown calls.

Main entry points: [`easyid/pipeline.py`](https://github.com/7drien/easyid/blob/master/easyid/pipeline.py) (Processing pipeline), [`main.py`](https://github.com/7drien/easyid/blob/master/main.py) (CLI launcher), [`easyid/config.py`](https://github.com/7drien/easyid/blob/master/easyid/config.py) (Photo standards), [`easyid/core/cropper.py`](https://github.com/7drien/easyid/blob/master/easyid/core/cropper.py) (Photo cropper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_main["CLI launcher<br/>[main.py]"]
  node_desktop["Desktop UI<br/>[app.py]"]
  node_api["Python API<br/>[__init__.py]"]
end

subgraph group_vision["Face processing"]
  node_pipeline["Processing pipeline<br/>[pipeline.py]"]
  node_detector["Face landmarks<br/>[detector.py]"]
  node_segmenter["Background segmentation<br/>[segmenter.py]"]
  node_cropper["Photo cropper<br/>[cropper.py]"]
  node_geometry["Face geometry<br/>[geometry.py]"]
end

subgraph group_compliance["Standards and output"]
  node_validator["Compliance checks<br/>[validator.py]"]
  node_config["Photo standards<br/>[config.py]"]
  node_printable["Print sheet and export<br/>[printable.py]"]
end

subgraph group_support["Model support"]
  node_models["Model cache<br/>[models.py]"]
end

node_user(("User"))
node_portrait["Portrait input"]
node_result["Photo and report<br/>[pipeline.py]"]
node_modelhost["Model host"]
node_saved["Saved images"]

node_user -->|"runs CLI"| node_main
node_user -->|"opens UI"| node_desktop
node_user -->|"calls API"| node_api
node_portrait -->|"supplies image"| node_main
node_main -->|"launches"| node_desktop
node_main -->|"processes with"| node_pipeline
node_desktop -->|"processes with"| node_pipeline
node_api -->|"exposes"| node_pipeline
node_pipeline -->|"detects face"| node_detector
node_pipeline -->|"extracts mask"| node_segmenter
node_pipeline -->|"crops image"| node_cropper
node_cropper -->|"computes transform"| node_geometry
node_pipeline -->|"validates image"| node_validator
node_pipeline -->|"generates sheet"| node_printable
node_pipeline -->|"returns"| node_result
node_pipeline -->|"uses standards"| node_config
node_cropper -->|"sets target dimensions"| node_config
node_validator -->|"checks thresholds"| node_config
node_printable -->|"uses sheet dimensions"| node_config
node_detector -->|"loads model"| node_models
node_segmenter -->|"loads model"| node_models
node_models -->|"downloads model"| node_modelhost
node_result -->|"saves images"| node_saved

click node_main "https://github.com/7drien/easyid/blob/master/main.py"
click node_desktop "https://github.com/7drien/easyid/blob/master/easyid/ui/app.py"
click node_api "https://github.com/7drien/easyid/blob/master/easyid/__init__.py"
click node_pipeline "https://github.com/7drien/easyid/blob/master/easyid/pipeline.py"
click node_detector "https://github.com/7drien/easyid/blob/master/easyid/core/detector.py"
click node_segmenter "https://github.com/7drien/easyid/blob/master/easyid/core/segmenter.py"
click node_cropper "https://github.com/7drien/easyid/blob/master/easyid/core/cropper.py"
click node_geometry "https://github.com/7drien/easyid/blob/master/easyid/core/geometry.py"
click node_validator "https://github.com/7drien/easyid/blob/master/easyid/core/validator.py"
click node_config "https://github.com/7drien/easyid/blob/master/easyid/config.py"
click node_printable "https://github.com/7drien/easyid/blob/master/easyid/printable.py"
click node_result "https://github.com/7drien/easyid/blob/master/easyid/pipeline.py"
click node_models "https://github.com/7drien/easyid/blob/master/easyid/models.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_main,node_desktop,node_api,node_user toneBlue
class node_pipeline,node_detector,node_segmenter,node_cropper,node_geometry toneAmber
class node_validator,node_config,node_printable toneMint
class node_models toneRose
class node_portrait,node_modelhost,node_saved toneIndigo
class node_result toneTeal
```

## Components

### User entry points

- [CLI launcher](https://github.com/7drien/easyid/blob/master/main.py): `main.py`
- [Desktop UI](https://github.com/7drien/easyid/blob/master/easyid/ui/app.py): `easyid/ui/app.py`
- [Python API](https://github.com/7drien/easyid/blob/master/easyid/__init__.py): `easyid/__init__.py`

### Face processing

- [Processing pipeline](https://github.com/7drien/easyid/blob/master/easyid/pipeline.py): `easyid/pipeline.py`
- [Face landmarks](https://github.com/7drien/easyid/blob/master/easyid/core/detector.py): `easyid/core/detector.py`
- [Background segmentation](https://github.com/7drien/easyid/blob/master/easyid/core/segmenter.py): `easyid/core/segmenter.py`
- [Photo cropper](https://github.com/7drien/easyid/blob/master/easyid/core/cropper.py): `easyid/core/cropper.py`
- [Face geometry](https://github.com/7drien/easyid/blob/master/easyid/core/geometry.py): `easyid/core/geometry.py`

### Standards and output

- [Compliance checks](https://github.com/7drien/easyid/blob/master/easyid/core/validator.py): `easyid/core/validator.py`
- [Photo standards](https://github.com/7drien/easyid/blob/master/easyid/config.py): `easyid/config.py`
- [Print sheet and export](https://github.com/7drien/easyid/blob/master/easyid/printable.py): `easyid/printable.py`

### Model support

- [Model cache](https://github.com/7drien/easyid/blob/master/easyid/models.py): `easyid/models.py`

### Other components

- **User**
- **Portrait input**
- [Photo and report](https://github.com/7drien/easyid/blob/master/easyid/pipeline.py): `easyid/pipeline.py`
- **Model host**
- **Saved images**

## Connections

- User → CLI launcher: runs CLI (evidence: `main.py`)
- User → Desktop UI: opens UI (evidence: `README.md`)
- User → Python API: calls API (evidence: `README.md`)
- Portrait input → CLI launcher: supplies image (evidence: `main.py`)
- CLI launcher → Desktop UI: launches (evidence: `main.py`)
- CLI launcher → Processing pipeline: processes with (evidence: `main.py`)
- Desktop UI → Processing pipeline: processes with (evidence: `easyid/ui/app.py`)
- Python API → Processing pipeline: exposes (evidence: `easyid/__init__.py`)
- Processing pipeline → Face landmarks: detects face (evidence: `easyid/pipeline.py`)
- Processing pipeline → Background segmentation: extracts mask (evidence: `easyid/pipeline.py`)
- Processing pipeline → Photo cropper: crops image (evidence: `easyid/pipeline.py`)
- Photo cropper → Face geometry: computes transform (evidence: `easyid/core/cropper.py`)
- Processing pipeline → Compliance checks: validates image (evidence: `easyid/pipeline.py`)
- Processing pipeline → Print sheet and export: generates sheet (evidence: `easyid/pipeline.py`)
- Processing pipeline → Photo and report: returns (evidence: `easyid/pipeline.py`)
- Processing pipeline → Photo standards: uses standards (evidence: `easyid/pipeline.py`)
- Photo cropper → Photo standards: sets target dimensions (evidence: `easyid/core/cropper.py`)
- Compliance checks → Photo standards: checks thresholds (evidence: `easyid/core/validator.py`)
- Print sheet and export → Photo standards: uses sheet dimensions (evidence: `easyid/printable.py`)
- Face landmarks → Model cache: loads model (evidence: `easyid/core/detector.py`)
- Background segmentation → Model cache: loads model (evidence: `easyid/core/segmenter.py`)
- Model cache → Model host: downloads model (evidence: `easyid/models.py`)
- Photo and report → Saved images: saves images (evidence: `easyid/pipeline.py`)
