基于facenet的人脸识别

facenet_recognition的Python项目详细描述


人脸识别

基于facenet的人脸识别

使用Facenet构建 通过深入学习建立的最先进的人脸识别。模型 在Labeled Faces in the Wild基准上的精度为99.2%。

功能

  • 开箱即用的工作面识别
  • 从FaceNet中选择任何经过预培训的型号
  • 对于培训,请提供正确的文件夹结构
  • 比其他可用解决方案更快

先决条件

  • 您需要安装python(2.6到3.5)
  • 基于x的系统支持(在windows上有效,但未经测试)

安装
pipinstallfacenet_recognition
设置

创建如下设置:

  1. 创建输入目录例如:input_images
  2. 创建对齐图像目录例如:对齐图像创建此 目录我们将在这里存储对齐的图像
  3. 创建预先训练的模型目录例如:pre trained_facenet_model 从下载预先训练的模型 ` facenet `并保留它 在pre_model目录中
  4. 创建我的训练有素的分类器目录,例如:my_classifier在此 目录我们将保存我们的培训模型

让我们开始

对于面部识别,我们需要按如下方式对齐图像:

importfacenet_recognitionfacenet_recognition.align_input('input_images','aligned_images')

上面的命令将把我们的输入图像创建为对齐格式并保存 它位于给定的对齐图像文件夹

在图像上训练和测试分类器

在我们对齐图像之后,现在我们可以训练分类器了。

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每人需要的图像1number张用于培训的图像 每人30美元(可配置)

在图像上训练Classifier(仅限训练)

此api用于在对齐的图像上训练分类器

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='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每人需要的图像1number张用于培训的图像 每人30美元(固定)

在图像上测试Classifier

此API用于测试我们训练有素的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='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每人需要的图像1

作者

许可证

这个项目是根据麻省理工学院的许可证授权的-参见 LICENSE.md有关详细信息的文件

致谢

  • 非常感谢David Sandberg为Facent所做的贡献
  • 灵感来源于基于dlib的图书馆人脸识别

历史记录

0.1.4(2018-28-03)

  • 第一个测试版。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
AmazonS3查找从S3forJava下载的压缩文件的MIME类型   java如何使用Selenium在<span>中查找具有特定文本的元素   python如何使用OpenIEDemo生成自定义三元组。由stanfordnlp提供的java   java遇到“方法不适用”编译错误   java如何使用Mockito在Looper中运行的验证代码。getMainLooper?   类Java目录错误   java在已知其他泛型信息时使用原始类型   java connect()和disconnect()在哪里实现?   java使用PDF Box库拆分PDF,生成的PDF几乎与源PDF文件大小相同   java PowerMockito返回错误的对象   java如何找到TIBCO集合消息的字节编码?   java Basic音乐播放器下一步和上一步按钮   添加模块描述符时,java没有名为“entityManagerFactory”的bean可用   java为什么我的代码不是线程安全的?   eclipse java。引用项目中的类的lang.NoClassDefFoundError