Git Product home page Git Product logo

face-recognition's Introduction

基于opencv、tensorflow的人脸识别

BY GJ

使用指南

  1. 运行catch_face.py获取自己的脸

需要修改opencv人脸分类器的地址,分类器文件可见haarcascades文件夹 。
或者执行catch_face_cv.py,图片将保存在myface文件夹(可自定义)。

  1. 可使用other_face.py处理其他人的图片。
    或者重复上一步采集另一个人的脸用作other_face。

例如处理lfw图片集(face_data3)。

  1. face_data.py作为模块用于后续图片的预处理。

  2. 运行face_train.py来训练神经网络。

载入的数据集即为face_data文件夹,包含myface文件夹和other_faces文件夹。 训练过程,终端显示每一波训练时训练和测试的损失和准确率,训练结束将模型保存至model文件夹。

  1. 运行face_r.py可以打开摄像头开始识别我的脸了。

环境配置

  • ubuntu18.04+Anaconda
  • 推荐使用Anaconda(一个提供包管理和环境管理的python版本)。 官网下载
  • 推荐修改镜像地址:

pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

  • 安装需要的python库:(缺少相应的库可用conda或者pip自行安装)

conda install scikit-learn
pip install opencv-python
conda install -c conda-forge tensorflow
pip install --ignore-installed --upgrade https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/tensorflow-1.7.0-cp36-cp36m-linux_x86_64.whl

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.