Giter VIP home page Giter VIP logo

face2face's Introduction

Facial Capture

This is a Python package to fit 3D morphable models (3DMMs) to images of faces. It mainly provides classes to work with and render 3DMMs, and functions that use these classes to optimize the objective of fitting 3DMMs to a source RGB image or a video for facial performance capture.

Facial Capture Example

Features

  • Fit a 3DMM shape model to a RGB image
  • Joint optimization of rendering pixel error and landmarks fitting
  • Fit a 3DMM texture model with spherical harmonic lighting to a source RGB image
  • Recover the barycentric parameters of the underlying verticles from the 3DMM mesh triangles that contribute to each pixel of a person's face in an image
  • Extract per vertex texture
  • Track expressions and spherical harmonic lighting over a sequence of images (or a video)

Prerequisites

  • Python 3
  • Install all requirements with pip: pip install -r requirements.txt .
  • Install face2face library: pip install -e .

You need to download 2017 BFM model as we aren't allowed to share it:

  • Create models folder under Facial-Capture
  • Download Basel model 2017 model from here to models folder
  • Process via python processBFM2017.py

Also you would need the trained landmark dlib predictor:

  • Download and extract shape_predictor_68_face_landmarks from here to models folder

Running

  • First create a face identity (use 1 to 3 images max) using

    python cli/initialize.py --input_dir path_to_init_images --output_dir path_to_save_identity
  • After creating the identity, you can now track the expressions using:

    python cli/tracker.py --input_dir path_to_tracking_images --output_dir path_to_save_tracking --parameters path_to_save_identity/params.npy

face2face's People

Contributors

kimoktm 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

Watchers

 avatar  avatar

face2face's Issues

How to run demo memory efficiently?

Hi, I have tested your code. but It occurrred memory running out.
My computer has 16GB mem windows 10.
could you tell me the system required?

ValueError: setting an array element with a sequence.

Thks the author job!

I play the python cli/processBFM2017.py the cli, get the error:
Traceback (most recent call last):
File "cli/processBFM2017.py", line 87, in
processBFM2017('./models/model2017-1_bfm_nomouth.h5', '')
File "cli/processBFM2017.py", line 76, in processBFM2017
vertex2face = np.array([np.where(np.isin(face, vertexInd).any(axis = 0))[0] for vertexInd in range(numVertices)])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (53149,) + inhomogeneous part.

I tried the ./models/model2017-1_face12_nomouth.h5 and ./models/model2017-1_bfm_nomouth.h5, the same error occured.

Any reference about optimization?

Hi,I am studying 3d face reconstruction based 3DMM and I am curious about the objective function and the construction of Jacobian matrix.Do you have some references? 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.