# mandavavasanth/face_recognization architecture

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

- Interactive diagram: https://gitdiagram.com/mandavavasanth/face_recognization
- Repository: https://github.com/mandavavasanth/face_recognization

## Overview

FaceVerify is a command-line identity-verification pipeline: a user supplies an image, the CLI extracts a face embedding and crop, searches for a likely identity, then submits a proof and source URL for blockchain notarization. The graph separates face analysis, identity search, and notarization, with the CLI as the orchestration layer. The README documents the contract’s on-chain role; its implementation was not sampled, so that relationship is documented rather than inferred from Solidity source.

Main entry points: [`main.py`](https://github.com/mandavavasanth/face_recognization/blob/main/main.py) (Pipeline CLI), [`stages/face_detect.py`](https://github.com/mandavavasanth/face_recognization/blob/main/stages/face_detect.py) (Face detection), [`stages/reverse_search.py`](https://github.com/mandavavasanth/face_recognization/blob/main/stages/reverse_search.py) (Identity search), [`stages/blockchain.py`](https://github.com/mandavavasanth/face_recognization/blob/main/stages/blockchain.py) (Proof submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_face["Face analysis"]
  node_face_detection["Face detection<br/>[face_detect.py]"]
  node_embedding_hash["Proof hash<br/>[main.py]"]
  node_face_crop["Face crop"]
end

subgraph group_search["Identity search"]
  node_identity_search["Identity search<br/>[reverse_search.py]"]
  node_serpapi{{"SerpApi / Lens"}}
  node_search_results["Selected match"]
end

subgraph group_chain["Blockchain notarization"]
  node_chain_submit["Proof submission<br/>[blockchain.py]"]
  node_proof_registry["ProofRegistry<br/>[ProofRegistry.sol]"]
  node_polygon{{"Polygon Amoy"}}
  node_proof_record[("On-chain proof")]
end

node_user(("CLI user"))
node_pipeline["Pipeline CLI<br/>[main.py]"]

node_user -->|"provides image"| node_pipeline
node_pipeline -->|"calls detection"| node_face_detection
node_face_detection -->|"returns embedding"| node_pipeline
node_face_detection -->|"saves crop"| node_face_crop
node_pipeline -->|"hashes embedding"| node_embedding_hash
node_pipeline -->|"searches crop"| node_identity_search
node_identity_search -->|"uploads and queries"| node_serpapi
node_identity_search -->|"selects match"| node_search_results
node_pipeline -->|"submits proof"| node_chain_submit
node_chain_submit -->|"sends transaction"| node_polygon
node_chain_submit -->|"calls registerProof"| node_proof_registry
node_proof_registry -.->|"records proof"| node_proof_record

click node_pipeline "https://github.com/mandavavasanth/face_recognization/blob/main/main.py"
click node_face_detection "https://github.com/mandavavasanth/face_recognization/blob/main/stages/face_detect.py"
click node_embedding_hash "https://github.com/mandavavasanth/face_recognization/blob/main/main.py"
click node_identity_search "https://github.com/mandavavasanth/face_recognization/blob/main/stages/reverse_search.py"
click node_chain_submit "https://github.com/mandavavasanth/face_recognization/blob/main/stages/blockchain.py"
click node_proof_registry "https://github.com/mandavavasanth/face_recognization/blob/main/contracts/ProofRegistry.sol"

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_face_detection,node_embedding_hash,node_face_crop,node_user toneBlue
class node_identity_search,node_serpapi,node_search_results toneAmber
class node_chain_submit,node_proof_registry,node_polygon,node_proof_record toneMint
class node_pipeline toneTeal
```

## Components

### Face analysis

- [Face detection](https://github.com/mandavavasanth/face_recognization/blob/main/stages/face_detect.py): `stages/face_detect.py`
- [Proof hash](https://github.com/mandavavasanth/face_recognization/blob/main/main.py): `main.py`
- **Face crop**

### Identity search

- [Identity search](https://github.com/mandavavasanth/face_recognization/blob/main/stages/reverse_search.py): `stages/reverse_search.py`
- **SerpApi / Lens**
- **Selected match**

### Blockchain notarization

- [Proof submission](https://github.com/mandavavasanth/face_recognization/blob/main/stages/blockchain.py): `stages/blockchain.py`
- [ProofRegistry](https://github.com/mandavavasanth/face_recognization/blob/main/contracts/ProofRegistry.sol): `contracts/ProofRegistry.sol`
- **Polygon Amoy**
- **On-chain proof**

### Other components

- **CLI user**
- [Pipeline CLI](https://github.com/mandavavasanth/face_recognization/blob/main/main.py): `main.py`

## Connections

- CLI user → Pipeline CLI: provides image (evidence: `README.md`)
- Pipeline CLI → Face detection: calls detection (evidence: `main.py`)
- Face detection → Pipeline CLI: returns embedding (evidence: `stages/face_detect.py`)
- Face detection → Face crop: saves crop (evidence: `stages/face_detect.py`)
- Pipeline CLI → Proof hash: hashes embedding (evidence: `main.py`)
- Pipeline CLI → Identity search: searches crop (evidence: `main.py`)
- Identity search → SerpApi / Lens: uploads and queries (evidence: `stages/reverse_search.py`)
- Identity search → Selected match: selects match (evidence: `stages/reverse_search.py`)
- Pipeline CLI → Proof submission: submits proof (evidence: `main.py`)
- Proof submission → Polygon Amoy: sends transaction (evidence: `stages/blockchain.py`)
- Proof submission → ProofRegistry: calls registerProof (evidence: `stages/blockchain.py`)
- ProofRegistry → On-chain proof: records proof (evidence: `README.md`)
