This repo experiments with the FaceNet implementation from David Sandberg. It includes a copy of the implementation and uses Docker for easy reproducibility. FaceNet is a neural network written in TensorFlow. It computes for a given Image a so-called embedding. These embeddings are vectors of dimension 512 and encode the similarity of faces, meaning that faces which are similar has a smaller euclidean distance than less similar faces. This property can be used for face recognition.
If you want to see the results, check out this notebook
https://docs.docker.com/engine/installation/
https://docs.docker.com/compose/install/
You can download the CelebA Dataset from the projects gdrive. Download the files img_align_celeba.zip and identity_CelebA.txt and move them to the folder input. On a Linux system unzip img_align_celeba.zip unzip it with the following command in the top-level directory
cd input && unzip img_align_celeba.zip
Downlad precomputed embeddings for the images: embeddings.zip. Computing the embeddings on your own can take several hours. Put this file into the folder output. On a Linux system unzip it with the following command in the top-level directory
cd output && unzip embeddings.zip
You can now run the notebook. Execute this command in the top-level directory:
docker-compose -f docker-compose-notebook.yml up
You can open the notebook then by using the link you see in the console:
http://localhost:8888/?token=SOME_TOKEN
Then click on the file
celebAExploration.ipynb
Jupyter Notebook generates a new token on every startup. So you must use the link from the console.
You can also ompute embeddings for your own dataset. Place your pictures in the folder input. Then run the command
docker-compose build && docker-compose up
Caution: this command expects the existence of subfolders e.g. ./input/mypictures/.... Putting the pictures directly in the input folder will unfortunately result in a cryptic error.