Turn flat portraits into 3D face meshes with modern C++
eos is a lightweight, header-only C++ engine that fits 3D Morphable Face Models to 2D portraits, offering linear pose, shape, and expression estimation without mandatory dependencies.

What it does
This library reconstructs 3D face geometry from 2D images using Morphable Face Models. It handles linear camera pose estimation, shape fitting to facial landmarks, and expression fitting via six basic blendshapes, outputting standard OBJ meshes and texture maps. The distribution includes a low-resolution, shape-only Surrey Face Model and supports loading several major third-party models out of the box.
The interesting bit
The project keeps the heavy lifting strictly linear—pose, shape, and expression are solved with direct matrix operations rather than iterative black-box optimizers—which keeps the core header-only and free of external dependencies. An experimental non-linear fitting path using Ceres is available, but the library’s real value is its refusal to bloat.
Key highlights
- Header-only core library with no external dependencies.
- Supports the Surrey Face Model, 4D Face Model, Basel Face Model 2009/2017, and Liverpool-York Head Model.
- Linear fitting pipeline covers pose, shape, expression, and edge/contour alignment.
- Python bindings available as
eos-pyon PyPI. - Experimental non-linear cost functions and Matlab bindings are present, though the Matlab interface is currently unmaintained.
Caveats
- The bundled Surrey Face Model is restricted to non-commercial use; commercial work requires a separate license.
- Non-linear fitting and Matlab bindings are explicitly marked experimental or unmaintained.
- Example applications require Boost and OpenCV, so the zero-dependency claim applies only to the core library itself.
Verdict
Computer-vision researchers and graphics developers who need a self-contained, lightweight 3DMM fitting engine will find this genuinely useful. If you are looking for a production-grade, end-to-end deep-learning face-reconstruction pipeline, look elsewhere.
Frequently asked
- What is patrikhuber/eos?
- eos is a lightweight, header-only C++ engine that fits 3D Morphable Face Models to 2D portraits, offering linear pose, shape, and expression estimation without mandatory dependencies.
- Is eos open source?
- Yes — patrikhuber/eos is open source, released under the Apache-2.0 license.
- What language is eos written in?
- patrikhuber/eos is primarily written in C++.
- How popular is eos?
- patrikhuber/eos has 2k stars on GitHub.
- Where can I find eos?
- patrikhuber/eos is on GitHub at https://github.com/patrikhuber/eos.