Package: facenet_recognition
Face RecognitionFace Recognition Based on FacenetBuilt usingFacenet’s
state-of-the-art face recognition built with deep learning. The model
has an accuracy of 99.2% on theLabeled Faces in the
Wildbenchmark.FeaturesOut of Box Working Face RecognitionChoose Any Pre-Trained Model from FacenetFor training just provide the proper folder structureFaster than other available solutionsPrerequisitesYou need Python(2.6 to 3.5) installedX-based System supported(does work on Windows but not tested)Installingpipinstallfacenet_recognitionSetupCreate setup as follows:Create input directory eg: input_imagesCreate aligned images directory eg: aligned_imagesCreate this
directory we will store aligned images hereCreate pre-trained model directory eg: pretrained_facenet_modelDownload Pre-Trained model from
`Facenet`and keep it
in the pre_model directoryCreate my trained classifier directory eg: my_classifierIn this
directory we will save our trained modelLet’s BeginFor Facial Recognition we need to align images as follows:importfacenet_recognitionfacenet_recognition.align_input('input_images','aligned_images')Above command will create our input images into aligned format and save
it in given aligned images folderTrain & Test Classifier on ImagesAfter we have aligned images now we can train our classifier.pre_model='./pretrained_facenet_model/20170511-185253.pb'#locaiton of pret-trained model from Facenetmy_class='./my_classifier/my_classifier.pkl'#location where we want to savetest_classifier_type='svm'#type of model either svm or nnweight='./my_classifier/model_small.yaml'#local stored weightsfacenet_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:1Number of Images for Training
per Person:30 (configurable)Train Classifer on Images(only Training)This API is used to Train our Classifier on Aligned Imagespre_model='./pretrained_facenet_model/20170511-185253.pb'#locaiton of pret-trained model from Facenetmy_class='./my_classifier/my_classifier.pkl'#location where we want to savetest_classifier_type='nn'#type of model either svm or nnweight='./my_classifier/model_small.yaml'#local stored weightsfacenet_recognition.create_classifier(aligned_images,pre_model,my_class,weight,test_classifier_type)Mininum Required Image per person:1Number of Images for Training
per Person:30 (fixed)Test Classifer on ImagesThis API is used to test our Trained Classiferpre_model='./pretrained_facenet_model/20170511-185253.pb'#locaiton of pret-trained model from Facenetmy_class='./my_classifier/my_classifier.pkl'#location where we want to savetest_classifier_type='nn'#type of model either svm or nnweight='./my_classifier/model_small.yaml'#local stored weightsfacenet_recognition.test_classifier(aligned_images,pre_model,my_class,weight,test_classifier_type)Mininum Required Image per person:1AuthorsIshwar Sawale–Visit PortfolioLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsAcknowledgmentsBig Thanks to David Sandberg for FacentInspired by Dlib based library face_recognitionHistory0.1.4 (2018-28-03)First beta release.