This project was developed under a previous phase of the Yale Digital Humanities Lab. Now a part of Yale Library’s Computational Methods and Data department, the Lab no longer includes this project in its scope of work. As such, it will receive no further updates.
Crop and vectorize faces from input images. Packaged from David Sandberg's facenet, based on the paper FaceNet (2015).
pip install yale-dhlab-facenet
To crop all faces in data/*.jpg
, one can run:
from facenet.crop import crop_faces
crop_faces({'input_glob': 'data/*.png'})
Extracted faces will be written to ./cropped
To obtain FaceNet embeddings for each face image in a directory, one can run:
from facenet.model import get_embeddings
get_embeddings({'input_glob': 'cropped/data/*.png'})
This process will write create a directory facenet_vectors
, and will write one numpy array to that directory for each image in input_glob
.