人脸识别系统的实现与封装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chenzhenyu123456/article/details/80751477

看paper和algorithm时间长了也会累,抽时间动动手也是很有好处的。但没想到汇总一个人脸识别Demo发到Github上花这么长时间 (ˉ▽ˉ;)…不管怎么样,希望对大家有所帮助。
  Demo地址:Github

Introduction

这是我在Pycharm IDE下结合MTCNN[1] 和FaceNet[2] 实现的,它可以对任意的数据集进行训练并实现人脸验证、人脸识别和人脸查找的功能。最后,我使用Tkinter制作了用户界面,使用者可以很方便的进行操作。如果你想学习人脸识别或者Tkinter UI的话,我相信我的项目会对你有所帮助。
  这里我使用的是英文界面(虽然朋友同意我放网上,但直接用中文标注名字感觉不太好),大家在程序中可以自行选择中英文(修改language = ‘chinese’ or ‘english’)。

Results

  • 人脸验证 (验证 ChenZhenyu)
    Successful verification! This image was identified as ChenZhenyu!
    verification
  • 人脸识别
    Detected LiuXin,YangShuntao,LiJialong,ChenZhenyu,LiuKe,ZhangYuchan,ZhangJinrui in this image!
    recognition
  • 人脸查找 (search ChenZhenyu, LiuKe)
    Found ChenZhenyu,LiuKe in this image!
    search

Environment

  • Windows 10
    Python 3.6.4 + TensorFlow 1.6.0 + tk 8.5.19 + dlib 19.4 + opencv 3.4.1 + scikit-image 0.13.0 + scikit-learn 0.19.1
  • Ubuntu 16.04
    Python 3.6.2 + TensorFlow 1.3.0 + tk 8.5.18 + dlib 19.4 + opencv 3.1.0 + scikit-image 0.13.0 + scikit-learn 0.19.0

建议在Ubuntu下使用英文,Windows系统下中英文均可。

UI Display

Windows (程序同样可以运行在Ubuntu系统)

Login

Choose
Login

Train

TrainingParameters
TrainingProcess

Retrieval

搜索图片,在检索UI的右侧展示它们。
Retrieval

Predict

可以在预测UI的右侧可视化最后的图像结果
Predict

Notebook Display

你可以通过 face_recognition_process.ipynb 来了解详细流程。

How to use it

Folder Structure

models/
----------20170512-110547/
--------------------20170512-110547.pd
--------------------model-20170512-110547.ckpt-250000.data-00000-of-00001
--------------------model-20170512-110547.ckpt-250000.index
--------------------model-20170512-110547.meta
----------mtcnn/
--------------------det1.npy
--------------------det2.npy
--------------------det3.npy
----------my_models/
----------shape_predictor_68_face_landmarks.dat
dataset/
----------train_english/
--------------------XiaoMing/
------------------------------XiaoMing1.jpg
------------------------------...
--------------------XiaoHu/
------------------------------XiaoHu1.jpg
------------------------------...
--------------------...
----------train_chinese/
--------------------小明/
------------------------------XiaoMing1.jpg
------------------------------...
--------------------小虎/
------------------------------XiaoHu1.jpg
------------------------------...
--------------------...

Reference

[1] MTCNN
[2] FaceNet

猜你喜欢

转载自blog.csdn.net/chenzhenyu123456/article/details/80751477