Giter Club home page Giter Club logo

eos's Introduction

eos: A lightweight header-only 3D Morphable Face Model fitting library in modern C++11/14.

GitHub release Apache License 2.0

eos is a tiny 3D Morphable Face Model fitting library that provides just the bare minimum to load a model and perform camera and shape fitting. It's written in modern C++11/14.

At the moment, it mainly provides the following functionality:

  • MorphableModel class to represent a 3DMM (using OpenCVs cv::Mat)
  • Camera pose estimation, implementation of:
    • the Gold Standard Algorithm for estimating an affine camera matrix, from Multiple View Geometry, Hartley & Zisserman
    • a non-linear algorithm that directly estimates the pose angles and camera translation
  • Shape fitting, implementation of the linear shape-to-landmarks fitting of O. Aldrian & W. Smith, Inverse Rendering of Faces with a 3D Morphable Model, PAMI 2013
  • Isomap texture extraction to obtain a pose-invariant representation of the face texture.

Usage

  • Tested with the following compilers: >=gcc-4.8.4, >=clang-3.5, Visual Studio 2015
  • Needed dependencies for the library: Boost system (>=1.50.0), OpenCV core (>=2.4.3)

To use the library in your own project, just add the following directories to your include path:

  • eos/include
  • eos/3rdparty/cereal-1.1.1/include
  • eos/3rdparty/glm-0.9.7.0

Build the examples and tests

  • Needed dependencies for the example app: CMake (>=2.8.10), Boost system, filesystem, program_options (>=1.50.0), OpenCV core, imgproc, highgui (>=2.4.3).

To build:

  • copy initial_cache.cmake.template to initial_cache.cmake, edit the necessary paths
  • create a build directory next to the eos folder: mkdir build; cd build
  • cmake -C ../eos/initial_cache.cmake -G "<your favourite generator>" ../eos -DCMAKE_INSTALL_PREFIX=../install/
  • build using your favourite tools, e.g. make; make install or open the solution in Visual Studio.

Sample code

See examples/fit-model.cpp.

After make install or running the INSTALL target, an example image with landmarks can be found in install/bin/data/. The model and the necessary landmarks mapping file are installed to install/share/.

You can run the example just by running:

fit-model

Or, by manually specifying the face model, landmark vertex mappings, an image and its 2D landmarks:

fit-model -m ../share/sfm_shape_3448.bin -p ../share/ibug2did.txt -i data/image_0010.png -l data/image_0010.pts

The output is an obj file with the shape and a png with the extracted isomap. The estimated pose angles and shape coefficients are available in the code via the API.

Documentation

Doxygen: http://patrikhuber.github.io/eos/doc/

The fit-model example and the Namespace List in doxygen are a good place to start.

License & contributions

This code is licensed under the Apache License, Version 2.0

Contributions are very welcome! (best in the form of pull requests.) Please use Github issues for any bug reports, ideas, and discussions.

If you use this code in your own work, please cite the following paper: Fitting 3D Morphable Models using Local Features, P. Huber, Z. Feng, W. Christmas, J. Kittler, M. Rätsch, IEEE International Conference on Image Processing (ICIP) 2015, Québec City, Canada (http://arxiv.org/abs/1503.02330).

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.