Skip to content

zhenyuczy/Face-recognition

Repository files navigation

中文请参考我的CSDN博客

Introduction

This is a Face-recognition demo that I combined with MTCNN[1] and FaceNet[2] under the PyCharm IDE. It can train any dataset and implement face verification, face recognition and face search functions. Finally, I used Tkinter to make the interface, and the user could easily operate it. Anyway if you want to learn face recognition or Tkinter UI, I believe my project will help you.

Results

  • Face Verification (Verification ChenZhenyu)

Successful Verification! This image was identified as ChenZhenyu!

image

  • Face Recognition

Detected LiuXin,YangShuntao,LiJialong,ChenZhenyu,LiuKe,ZhangYuchan,ZhangJinrui in this image!

image

  • Face Search (search ChenZhenyu, LiuKe)

Found ChenZhenyu,LiuKe in this image!

image

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

Under Ubuntu, it is recommended that you choose English (Chinese display sometimes has problems).

UI Display

Windows (The program can also run under Ubuntu system)

Login

image
image

Train

image
image

Retrieval

Search the images and display them on the right side of the UI
image

Predict

Visualize the result of the image on the right side of the UI
image

Notebook Display

Please see face_recognition_process.ipynb. It will help you to understand my code.

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

About

A face recognition demo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published