Code Monkey home page Code Monkey logo

faceconverter's Introduction

C++ implementation of PRNet on iOS

This project contains:

  1. Face reconstruct(Face swap) from only a single image.
  2. Face pose estimate and keypoints(68) in 3D model.

The origin python code with training is in PRNet.

Platfrom and requirements

1. iPhone SE, arm64
2. OpenCV 3.4.0
3. NCNN

Outline

  1. Mtcnn --> resize to 256x256 --> PRNet --> UV,Z --> Render 86906 triangles in 3D --> SeamlessClone
  2. Mtcnn --> resize to 256x256 --> PRNet --> 43867 vertices --> SVD to estimate pose
    Mtcnn --> resize to 256x256 --> PRNet --> 43867 vertices --> pick 68 points for sparse alignment

Application

  1. Face Swap, change the target face image(@"ref.jpg") to your own.
  2. Face 3D pose estimate and face keypoints in 3D.

About the configuration

There's 4 config files in this project.

1. face_ind.txt

This file is the index of [0,65535], which is the region of the WHITE area of the image[256x256] below.

2. uv_kpt_ind.txt

This file is the index of coordinate(x,y) for 68 keypoints refer to face_ind.txt

3. triangles.txt

86906 triangles' vertices index refer to face_ind.txt

4. canonical_vertices.txt

canonical model for pose estimate, there's coordinate (uv,z) of 43867 vertices

Other details

  1. About the Euler angles.

http://www.gregslabaugh.net/publications/euler.pdf

  1. 3D points transformation matrix.

http://nghiaho.com/?page_id=671

  1. Render 3D texture.

http://blackpawn.com/texts/pointinpoly/

faceconverter's People

Contributors

taylorlu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

faceconverter's Issues

Overlay face on static image

Dear Dong Lu,
Thank You a lot for that awesome face converter!
Could You please tell, is it possible to overlay ref.jpg on image instead of camera live stream?

Would be really appreciate for help!

About speed

Hi,I want to know how fast this project runs.
What are the advantages and disadvantages of PRNet thinking compared to the regression of 3DMM model parameters?
Thank you!

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.