face-recognition-models

raw JSON →
0.3.0 verified Mon Apr 27 auth: no python

Models used by the face_recognition package. Version 0.3.0 provides pre-trained models for face detection, facial landmarks, and face recognition (dlib models). The package is a dependency of face_recognition, not typically installed standalone. Release cadence is low.

pip install face-recognition-models
error ModuleNotFoundError: No module named 'face_recognition_models'
cause The package is not installed or is missing as a dependency.
fix
pip install face-recognition-models
error FileNotFoundError: [Errno 2] No such file or directory: 'dlib_face_recognition_resnet_model_v1.dat'
cause Trying to use a relative path instead of using models_path() to locate the model.
fix
Use models_path() as in the quickstart.
gotcha This package simply downloads model files; it is a dependency of face_recognition. Install it independently only if you need the model files directly.
fix Use face_recognition package for typical usage.
gotcha The models_path() function returns the directory where models are stored, not a single model file. Many users incorrectly assume it's a single model.
fix Use models_path() to get the directory, then construct the full path to the specific model file.

Locate the directory containing pre-trained models.

import face_recognition_models
print(face_recognition_models.models_path())
from face_recognition_models import models_path
import os
model_path = os.path.join(models_path(), 'dlib_face_recognition_resnet_model_v1.dat')
print(model_path)