Skip to content

Recopilation and implementation of various methods used for face recognition

License

Notifications You must be signed in to change notification settings

evd995/face_recognition_toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Recognition Module

This repository contains tools and different method to peform facial recognition. The algorithms that are supported so far are:

The main goal of this toolbox is to compare the performance of different facial recognition methods as done in this paper

Setup

How to install library

To use this library, clone the reopository using git clone https://github.com/evd995/face_recognition_toolbox.git

General Depencencies

Libraries used:

  • Numpy: pip install numpy
  • Matplotlib: pip install matplotlib
  • OpenCV: pip install opencv-python
  • Tensorflow: pip install tensorflow
  • Keras: pip install keras
    • AlexNet, GoogleNet and SqueezeNet can only run in Keras 1.2
  • dlib: pip install dlib
  • h5py: pip install h5py

Method Specific Depencencies

Each method has different installing instructions, each of which can be found bellow.

FaceNet

Simple example:

import cv2

# Add package to path
import sys
sys.path.append("/PATH_TO_CLONED_GIT/face_recognition_toolbox")

# Import package
from face_recognition_toolbox import predict

# Looks for "facenet-20180402-114759.pb" (default) in the "/weights" directory
descriptor = predict(image, method_name='FaceNet')

# Looks for "facenet-20180402-114759.pb" in the "/weights" directory using "model" parameter
descriptor = predict(image, method_name='FaceNet', model="facenet-20180402-114759.pb")

VGG-Face

  • Run pip install keras_vggface or follow instructions in https://github.com/rcmalli/keras-vggface#keras-vggface-
  • 2019-03-21: As of today, keras_vggface supports the models: vgg16, resnet50 and senet50. The default is resnet50 but it can be specified by passing the model parameter with the desired model name.

Simple example:

import cv2

# Add package to path
import sys
sys.path.append("/PATH_TO_CLONED_GIT/face_recognition_toolbox")

# Import package
from face_recognition_toolbox import predict

# Using default model (resnet50)
descriptor = predict(image, method_name='VGGFace')

# Specifying model with "model" parameter
descriptor = predict(image, method_name='VGGFace', model='resnet50')

face_recognition (dlib)

Simple example:

import cv2

# Add package to path
import sys
sys.path.append("/PATH_TO_CLONED_GIT/face_recognition_toolbox")

# Import package
from face_recognition_toolbox import predict

descriptor = predict(image, method_name='face_recognition')

OpenFace

WARNING: OpenFace can only run in Python 2.7

AlexNet, GoogleNet and SphereFace

WARNING: AlexNet, GoogleNet and SphereFace can only run in Python 2.7 and Keras 1.2.2

Tutorials/Demos

How to contribute

To contribute it is possible to perform a pull request. If your goal is to add a new method then follow the next steps:

  • Add a module in the methods directory that contains a class with a predict method.
  • Add the reference to the class here
  • Add instance and call to the predict method in utils.py

About

Recopilation and implementation of various methods used for face recognition

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published