Skip to main content

Face Recognition

Face Recognition Based on Facenet

Built using Facenet’s state-of-the-art face recognition built with deep learning. The model has an accuracy of 99.2% on the Labeled Faces in the Wild benchmark.

Features

  • Out of Box Working Face Recognition

  • Choose Any Pre-Trained Model from Facenet

  • For training just provide the proper folder structure

  • Faster than other available solutions

Prerequisites

  • You need Python(2.6 to 3.5) installed

  • X-based System supported (does work on Windows but not tested)

Installing

pip install facenet_recognition

Setup

Create setup as follows:

  1. Create input directory eg: input_images

  2. Create aligned images directory eg: aligned_images Create this directory we will store aligned images here

  3. Create pre-trained model directory eg: pretrained_facenet_model Download Pre-Trained model from `Facenet` and keep it in the pre_model directory

  4. Create my trained classifier directory eg: my_classifier In this directory we will save our trained model

Let’s Begin

For Facial Recognition we need to align images as follows:

import facenet_recognition
facenet_recognition.align_input('input_images','aligned_images')

Above command will create our input images into aligned format and save it in given aligned images folder

Train & Test Classifier on Images

After we have aligned images now we can train our classifier.

pre_model='./pretrained_facenet_model/20170511-185253.pb' #locaiton of pret-trained model from Facenet
my_class ='./my_classifier/my_classifier.pkl' #location where we want to save
test_classifier_type = 'svm' #type of model either svm or nn
weight= './my_classifier/model_small.yaml' #local stored weights

facenet_recognition.test_train_classifier(aligned_images,pre_model,my_class,weight,test_classifier_type,nrof_train_images_per_class=30, seed=102)

Mininum Required Image per person: 1 Number of Images for Training per Person: 30 (configurable)

Train Classifer on Images(only Training)

This API is used to Train our Classifier on Aligned Images

pre_model='./pretrained_facenet_model/20170511-185253.pb' #locaiton of pret-trained model from Facenet
my_class ='./my_classifier/my_classifier.pkl' #location where we want to save
test_classifier_type = 'nn' #type of model either svm or nn
weight= './my_classifier/model_small.yaml' #local stored weights

facenet_recognition.create_classifier(aligned_images,pre_model,my_class,weight,test_classifier_type)

Mininum Required Image per person: 1 Number of Images for Training per Person: 30 (fixed)

Test Classifer on Images

This API is used to test our Trained Classifer

pre_model='./pretrained_facenet_model/20170511-185253.pb' #locaiton of pret-trained model from Facenet
my_class ='./my_classifier/my_classifier.pkl' #location where we want to save
test_classifier_type = 'nn' #type of model either svm or nn
weight= './my_classifier/model_small.yaml' #local stored weights

facenet_recognition.test_classifier(aligned_images,pre_model,my_class,weight,test_classifier_type)

Mininum Required Image per person: 1

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Big Thanks to David Sandberg for Facent

  • Inspired by Dlib based library face_recognition

History

0.1.4 (2018-28-03)

  • First beta release.

Metadata

Release files for facenet_recognition 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for facenet_recognition 0.1.4
File Size Uploaded
facenet_recognition-0.1.4.tar.gz 1.9 MB Details

Release files / facenet_recognition-0.1.4.tar.gz

Download URL facenet_recognition-0.1.4.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
756f8879990c33e07f6e78db258587e79bf7ee63097061691736b21ffd6633e4
BLAKE2b-256 checksum
How to use checksums
f4cabc3517970eb7b2e1b5bad99603f1c0313d3a6bf1a0aeaf60edf7973ac821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page