/facenet_mtcnn_tensorflow_inference_engine

This is a modified and simplified inference engine of davidsandberg's facenet

Primary LanguagePython

FaceNet and MTCNN using Tensorflow

Required packages

  • Python 3.6
  • Tensorflow 1.8
  • opencv 3.4
  • Scipy
  • Numpy
  • Pickle
  • Sklearn

Download the pretrained weights

  • Download this pretrained Facenet model and copy to model folder.
  • Download this pretrained MTCNN models and copy to mtcnn_model.

Steps to create the embeddings

  • Add images to 'people' folder for creating the embeddings
  • Run the below code to create the embeddings
face_embedding = FaceEmbedding()
embedding = face_embedding.convert_to_embedding()

Steps the comapare nw images with existing embedding created by above step:

  • Run the below code for comparison(Please note provide the image to compare in convert_to_embedding method).
face_embedding = FaceEmbedding()
embedding = face_embedding.convert_to_embedding(single=True, img_path='face6.jpg')
emb_list = face_embedding.load_pickle()
face_embedding.ecuclidean_distance(emb_list, embedding)

Custom training for Facnet and MTCNN models

This repos is mainly make use of pretrained weights and act as inference engine for face recognition. If you want to train, facnet and MTCNN models for further, Use these great two links. Once the training finished, you can copy back the models to this repo and can start doing inference.