Git Product home page Git Product logo

face_tf's Introduction

简介

该项目基于tensorflow框架,实现了人脸检测、人脸特征提取、人脸属性(包含年龄、性别)功能。

预训练模型:

  1. opencv:

https://github.com/opencv/opencv/tree/master/data/haarcascades

  1. dlib:

http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2

  1. facenet:

20180402-114759 https://drive.google.com/file/d/1EXPBSXwTaqrSC0OhUdXNmKSh9qJUQ55-/view

  1. 年龄模型: https://drive.google.com/drive/folders/0B8N1oYmGLVGWbDZ4Y21GLWxtV1E

  2. 性别模型: https://drive.google.com/drive/folders/0B8N1oYmGLVGWemZQd3JMOEZvdGs

下载完这些预训练的模型后,放到./pre_models文件夹下面。

功能模块

我们将人脸检测、人脸特征提取、人脸属性的功能进行组合。该项目支持以下几种组合:

  • fd: 人脸检测;
  • fr: 人脸检测和特征提取;
  • fda: 人脸检测和人脸属性;
  • fa: 人脸属性;
  • fra: 人脸检测、特征提取以及人脸属性; 可以通过model_type这个参数来指定。

人脸检测

人脸检测模型包含:

  • opencv
  • dlib
  • mtcnn

可以通过model_name这个参数来指定。

python demo.py --model_type 'fa' --model_name 'opencv' \
            --file_name './data/1.jpg' \
            --model_dir './pre_models/opencv/haarcascade_frontalface_default.xml'

人脸特征提取

需要将训练好的模型下载到pre_models中。

python demo.py --model_type 'fr' --model_name 'facenet' \
            --file_name './data/2.jpg' \
            --model_dir './pre_models/dlib/shape_predictor_68_face_landmarks.dat'

人脸属性

目前支持age以及gender,表情的代码在陆续开发中。

python demo.py --model_type 'fa' --model_name 'mtcnn' --file_name './data/2.jpg'

face_tf's People

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.