GithubHelp home page GithubHelp logo

dreadlord1984 / peppa_pig_face_engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 610265158/peppa_pig_face_landmark

0.0 2.0 0.0 10.63 MB

A simple face detect and alignment method, which is easy and stable.

License: Apache License 2.0

Python 100.00%

peppa_pig_face_engine's Introduction

Peppa_Pig_Face_Engine

introduction

It is a simple demo including face detection and face aligment, and some optimizations were made to make the result smooth.

CAUTION: this is the tensorflow2.0 branch, if you want to work on tf1, please switch to tf1 branch, it still works.

Purpose: I want to make a face analyzer including face detect and face alignment. Most of the face keypoints codes that opensourced are neither stable nor smooth, including some research papers. And the commercial sdk is pretty expensive. So, there is Peppa_Pig_Face_Engine.

I think it is pretty cool, see the demo:

click the gif to see the video: demo

and with face mask: face mask

requirment

  • tensorflow2.0 (tensorflow1 need to switch to tf1 branch )

  • opencv

  • python 3.6

  • easydict

  • flask

update

2020.2.4: add http server

useage

  1. download pretrained model, put them into ./model
  • detector

     Lightnet_0.5  including a tflite model, 
      (time cost: mac [email protected], tf2.0 15ms+, tflite 8ms+-,input shape 320x320, model size 560K)
    
  • keypoints

    shufflenetv2_0.75   including a tflite model, 
     (time cost: mac [email protected], tf2.0 5ms+, tflite 3.7ms+- model size 2.5M)
    

    the dir structure as :

       ./model
       ├── detector
       │   ├── saved_model.pb
       │   └── variables
       │       ├── variables.data-00000-of-00002
       │       ├── variables.data-00001-of-00002
       │       └── variables.index
       ├── keypoints
       │   ├── saved_model.pb
       │   └── variables
       │       ├── variables.data-00000-of-00002
       │       ├── variables.data-00001-of-00002
       │       └── variables.index
    
  1. run python demo.py --cam_id 0 use a camera
    or python demo.py --video test.mp4 detect for a video
    or python demo.py --img_dir ./test detect for images dir no track
    or python demo.py --video test.mp4 --mask True if u want a face mask

start a http server

  1. run python demo.py --web 1

  2. test by run python web_demo_test.py,

the result is a json, formate: [{ "bbox": [x1, y1, x2, y2], "landmark": [[x1, y1], [x2, y2],[x3,y3],[...]]}]

Train

The project is based on two of my other repos, and both tensorflow1 and tensorflow2 are supported. If you want to train with your own data, or you want to know the details about the models, click them.

ps

The project is supported by myself, and i need your advice to improve it. Hope the codes can help you, contact me if u have any question. At last, i need your star,also your contribution.

TODO

  • Transfer to tensorflow 2.0
  • small model including tflite
  • add http server demo
  • Add some GAN model to make it fun ing....
  • 3-d face algorithm
  • a mobile device version, it is on the way, i learn a lot about mobile device. **
  • switch to pytorch, HAHA... dont worry it wont happen.

peppa_pig_face_engine's People

Contributors

610265158 avatar

Watchers

 avatar  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.