Coder Social home page Coder Social logo

face-recognition's Introduction

face-recognition项目介绍

这个项目有两个大功能:人脸预处理和CNN人脸训练与识别
由于不能上传大文件,需要下载shape_predictor_68_face_landmarks文件,在该文件夹内提供了下载链接
人脸数据需要自己造,暂不提供

需要注意

由于dlib新版API只支持python3.6,在其他版本的python环境中需要进行重构
对人脸切割部分代码进行以下的重构

cutting_position = (d.left(), d.top(), d.right(), d.bottom())
# 切割出人脸
im = Image.open(path)
region = im.crop(cutting_position)
# 人脸缩放
a = 500  # 人脸方格大小
if region.size[0] >= a or region.size[1] >= a:
    region.thumbnail((a, a), Image.ANTIALIAS)
else:
    region = region.resize((a, a), Image.ANTIALIAS)
# 将Image转化为cv2
region = cv2.cvtColor(np.asarray(region), cv2.COLOR_RGB2BGR)
# 保存人脸
cv2.imshow('region', region)
print(type(region))
cv2.waitKey(0)

1、人脸预处理

人脸活体检测:从原始图片中识别出人脸的位置,以及68个特征点位置,借助shape_predictor_68_face_landmarks模型。
image

脸部检测提取:从原始图片中将人脸提取出来
image

脸部检测提取:人脸旋转,可以将侧脸拉正
image

2、CNN人脸训练与识别

网络方案:2个卷积、2个pooling、两个全连接、所有激活函数均采用leaky_relu
原始数据截图:
image

处理后的数据:
image

训练效果:
image

测试效果:
image

赞助

face-recognition's People

Contributors

duhanmin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.