# ageitgey/face_recognition_models architecture

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

- Interactive diagram: https://gitdiagram.com/ageitgey/face_recognition_models
- Repository: https://github.com/ageitgey/face_recognition_models

## Overview

This is a small Python data package, not a face-recognition engine: it provides four dlib model files and functions that return their installed paths. The principal workflow is for the external face_recognition package to use this package’s model assets; callers can obtain each asset’s path through the corresponding locator function. The README documents the package’s role, and the excerpted initializer shows the path mappings. No model inference or storage service is implemented here.

Main entry points: [`face_recognition_models/__init__.py`](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/__init__.py) (Model location API), [`face_recognition_models/models/shape_predictor_68_face_landmarks.dat`](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/shape_predictor_68_face_landmarks.dat) (68-point landmarks), [`face_recognition_models/models/shape_predictor_5_face_landmarks.dat`](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/shape_predictor_5_face_landmarks.dat) (5-point landmarks), [`face_recognition_models/models/dlib_face_recognition_resnet_model_v1.dat`](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/dlib_face_recognition_resnet_model_v1.dat) (Recognition ResNet)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_face_recognition(("face_recognition"))
node_model_locations["Model location API<br/>[__init__.py]"]
node_landmarks_68["68-point landmarks"]
node_landmarks_5["5-point landmarks"]
node_recognition_resnet["Recognition ResNet"]
node_cnn_detector["CNN face detector"]

node_face_recognition -->|"uses models"| node_model_locations
node_model_locations -->|"locates"| node_landmarks_68
node_model_locations -->|"locates"| node_landmarks_5
node_model_locations -->|"locates"| node_recognition_resnet
node_model_locations -->|"locates"| node_cnn_detector

click node_model_locations "https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/__init__.py"
click node_landmarks_68 "https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/shape_predictor_68_face_landmarks.dat"
click node_landmarks_5 "https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/shape_predictor_5_face_landmarks.dat"
click node_recognition_resnet "https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/dlib_face_recognition_resnet_model_v1.dat"
click node_cnn_detector "https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/mmod_human_face_detector.dat"

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_recognition toneIndigo
class node_model_locations toneMint
class node_landmarks_68,node_landmarks_5,node_recognition_resnet,node_cnn_detector toneTeal
```

## Components

### Other components

- **face_recognition**
- [Model location API](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/__init__.py): `face_recognition_models/__init__.py`
- [68-point landmarks](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/shape_predictor_68_face_landmarks.dat): `face_recognition_models/models/shape_predictor_68_face_landmarks.dat`
- [5-point landmarks](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/shape_predictor_5_face_landmarks.dat): `face_recognition_models/models/shape_predictor_5_face_landmarks.dat`
- [Recognition ResNet](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/dlib_face_recognition_resnet_model_v1.dat): `face_recognition_models/models/dlib_face_recognition_resnet_model_v1.dat`
- [CNN face detector](https://github.com/ageitgey/face_recognition_models/blob/master/face_recognition_models/models/mmod_human_face_detector.dat): `face_recognition_models/models/mmod_human_face_detector.dat`

## Connections

- face_recognition → Model location API: uses models (evidence: `README.rst`)
- Model location API → 68-point landmarks: locates (evidence: `face_recognition_models/__init__.py`)
- Model location API → 5-point landmarks: locates (evidence: `face_recognition_models/__init__.py`)
- Model location API → Recognition ResNet: locates (evidence: `face_recognition_models/__init__.py`)
- Model location API → CNN face detector: locates (evidence: `face_recognition_models/__init__.py`)
