Giter Club home page Giter Club logo

examplebasedfacialrigging's Introduction

A method for generating a facial blendshape rig from a source rig and a set of corresponding example poses. The method alternates between optimizing for the blendshapes, utilizing an approach derived from Deformation Transfer, and for the blending weights. The resulting blendshapes carry the source's controller semantics and maintain the identity of the target.

Implemented in C++17

Using:

Build

Dependencies

Download and install Eigen, OpenMesh, and CXXOpts according to their documentation.

CMakeLists.txt

Adjustments to CMakeLists.txt may be necessary depending on your environment. Lines marked with "<<<" are likely candidates.

Build

To prepare the build environment, create a build directory and run cmake inside of it.

mkdir build
cd build
cmake ..

To build the Example-Based Facial Rigging, make the 'ebfr' target.

make ebfr

Execution

ebfr --source-blendshapes "../data/source/blendshapes" --source-poses "../data/source/poses/" --source-weights "../data/source/poses/weights.csv" --target-neutral "../data/target/blendshapes/neutral.obj" --target-poses "../data/target/poses/" --target-weights "../data/target/poses/weights.csv" --output "output"
  • --source-blendshapes: Path to the directory containing the source blendshape mesh files
    • Blendshapes are expected to be named sequentially from '0' and in OBJ format
  • --source-poses: Path to the directory containing the source pose mesh files
    • Pose mesh names are expected to match the names found in the weights file
  • --source-weights: Path to the source pose-weights file
    • See Weights CSV below
  • --target-neutral: Path to the target neutral mesh file
    • Neutral mesh is expected to be an OBJ file
  • --target-poses: Path to the directory containing the target pose mesh files
    • Pose mesh names are expected to match the names found in the weights file
  • --target-weights: Path to the target (estimated) pose-weights file
    • See Weights CSV below
  • --output Path to a directory to write the final target blendshapes

Weights CSV

Format

Header Row

Pose, 0, 1, ..., # of blendshapes

Row

PoseName, w0, w1, ..., wN

PoseName should match the name of a mesh in the corresponding poses directory

#####Example

Pose 0 1 2 3 4
Smile 0.1 0.2 0.3 0.4 0

Notes

  • There must be a one-to-one correspondence between source and target meshes.
  • The source and target poses must also correspond to one another.
  • All meshes are, at this time, expected to be in OBJ format
  • Runtime on a reasonable PC is roughly 50s with 13k vertices, 28 blendshapes, and 10 example poses.

Useful References

Deformation Transfer for Triangle Meshes by Sumner, Popovic. 2004 (Project)

Deformation Transfer for Detail-Preserving Surface Editing by Botsch, Sumner, Pauly, and Gross. 2006

examplebasedfacialrigging's People

Contributors

kyle-gh 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

Watchers

 avatar  avatar  avatar

examplebasedfacialrigging's Issues

Blendshape format

Thanks for release this code! I'm wondering what is the format of the input blendshapes. I've tried both neutral+diff and diff but neither worked.

"make ebfr" occurs "error: expected unqualified-id before ‘&’ token"

cmake .. successed, but make ebfr occurs

Consolidate compiler generated dependencies of target ebfr [ 7%] Building CXX object CMakeFiles/ebfr.dir/src/main.cpp.o In file included from/ExampleBasedFacialRigging/src/main.cpp:19:0: /ExampleBasedFacialRigging/src/Args.h: In member function ‘bool Args::read(int, char**)’: /ExampleBasedFacialRigging/src/Args.h:66:47: error: expected unqualified-id before ‘&’ token catch (const cxxopts::OptionException &e) { ^ /ExampleBasedFacialRigging/src/Args.h:66:47: error: expected ‘)’ before ‘&’ token /ExampleBasedFacialRigging/src/Args.h:66:47: error: expected ‘{’ before ‘&’ token /ExampleBasedFacialRigging/src/Args.h:66:48: error: ‘e’ was not declared in this scope catch (const cxxopts::OptionException &e) { ^ make[3]: *** [CMakeFiles/ebfr.dir/build.make:244: CMakeFiles/ebfr.dir/src/main.cpp.o] Error 1 make[2]: *** [CMakeFiles/Makefile2:91: CMakeFiles/ebfr.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:98: CMakeFiles/ebfr.dir/rule] Error 2 make: *** [Makefile:124: ebfr] Error 2

How to fix it? many thanks!!!

Example data

Hi, @kyle-gh :

Thanks for your great work! Could you please provide some example data (source/target pose, weight, vertex-mask)? I am quite confused about how to organize those files.

Thanks!

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.