Giter VIP home page Giter VIP logo

facedemo's Introduction

FaceDemo: a simple 3D face alignment and warping demo

Input: face image/video

Output: Textured 3D face model

Overview

This is the author's implementation of 3D face alignment and warping method described in:
Mirror Mirror: Crowdsourcing Better Portraits
Jun-Yan Zhu, Aseem Agarwala, Alexei A. Efros, Eli Shechtman, Jue Wang
In ACM Transactions on Graphics (Proceedings of SIGGRAPH Asia 2014)

Project Page

Please cite our paper if you use our code for your research.

@article{zhu2014mirror,
 author = {Jun-Yan Zhu and Aseem Agarwala and Alexei A Efros and Eli Shechtman and Jue Wang},
 title = {Mirror Mirror: Crowdsourcing Better Portraits},
 journal = {ACM Transactions on Graphics (SIGGRAPH Asia 2014)},
 volume = {33},
 number = {6},
 year = {2014},
}

Given an image or a video sequence that contains a face, the program can align and warp the face to a 3D face model. The user can further rotate/translate the face, and adjust the camera projection (perspective projection or orthogonal projection). The program also provides different OpenGL rendering options. See "Usage" for details.

Contact: Jun-Yan Zhu ([email protected])

Requirements

  • OpenCV:
sudo apt-get install libopencv-dev
  • OpenGL and GLUT:
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt-get install libxmu-dev libxi-dev
  • CLM Tracker by Jason Saragih (included)

Getting Started (Linux)

  • Download and unzip the code.

  • Run the following command.

mkdir cbuild
cd cbuild
cmake -DCMAKE_BUILD_TYPE=Release  ../
make

Usage

  1. Command line interface: ./FaceDemo mode filePath
    • Example (image): ./FaceDemo image ./data/bush.jpg
    • Example (video): ./FaceDemo video ./data/eli.avi
  2. The program displays three windows:
  • The "Detected Points" window shows the original input frame with the detected feature points.
  • The "3D Face" window shows a 3D face model rendered by OpenGL.
  • The "Projected Face" window shows a 2D projection result of the 3D face model. The program projects the 3D face back to the original image.
  1. User Interaction: "3D Face" window takes the user's keyboard input.
    • shift + arrow keys: translate the face.
    • arrow keys: rotate the face.
    • +/-: zoom in/out
    • p: toggle between a perspective projection and an orthogonal projection.
    • s: toggle between flat and smooth shading.
    • w: toggle between filled and wireframe mode.
    • t: toggle between static mode and transformation mode: for static mode, the 3D face model doesn't rotate and translate.
    • q: quit the program

facedemo's People

Contributors

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

facedemo's Issues

question

There are details about the program?

problems about the display

hi:
thank you very much for sharing the code.
when i run the demo, there is some problem about the opengl display. First, I add the glEnable( GL_CULL_FACE ) to disable the back of the face. then i rotate the 3d model to the left, the display becomes like this:
screenshot from 2017-12-08 10-48-57
there something wrong about the nose area. but when i rotate to the right, the display is all right:
screenshot from 2017-12-08 10-49-33
so, can you help me to solve this problem?
thanks very much !

question

I can't cmake success, about opencv: just excute sudo apt-get libopencv-dev? don't install opencv?

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.