Full-pose 3D face reconstruction from a single snapshot
It reconstructs dense 3D face geometry from a single 2D photo, even in extreme poses, using a lightweight CNN that runs in milliseconds.

What it does
3DDFA is a PyTorch reimplementation of a 2017 face-alignment paper that estimates dense 3D facial geometry—including 68 landmarks, vertex-level shape, pose, and depth—from a single unconstrained image. It ships with pre-trained MobileNet-V1 models and can export textured .obj meshes, point clouds, and auxiliary feature maps like PNCC and PAF.
The interesting bit
The project goes beyond the original paper by adding real-time training strategies, a Cython-accelerated render pipeline, and a simple C++ port. The author also released a successor (3DDFA_V2), so this repo sits in an odd spot: it is the improved PyTorch version of the 2017 work, yet no longer the latest iteration.
Key highlights
- Single-image inference outputs 3D meshes, pose angles, depth maps, and PNCC/PAF features simultaneously.
- GPU inference clocks in at roughly 0.27 ms per image when batching 128 frames on a TITAN X; CPU inference on a modern MacBook Pro lands around 14.5 ms.
- Built on MobileNet-V1, making the model compact enough to consider for mobile deployment.
- Includes full training scripts, loss variants (
WPDC,VDC,PDC), and pre-processed dataset configurations. - Optional
dlibintegration for face detection, but supports landmark-free cropping and custom bounding boxes.
Caveats
- The repo omits large binary files such as the
dlibdetection model, so you must download them separately before running anything. - Windows is explicitly untested; Linux and macOS are the supported platforms.
- The README openly points users to
3DDFA_V2(ECCV 2020) for the latest pre-trained models and code, so this version appears to be in spare-time maintenance.
Verdict
Good for researchers or hackers who need a fully open, training-ready 3D face pipeline in PyTorch and do not mind using slightly dated weights. Skip it if you want the latest accuracy or a turnkey, cross-platform tool.
Frequently asked
- What is cleardusk/3DDFA?
- It reconstructs dense 3D face geometry from a single 2D photo, even in extreme poses, using a lightweight CNN that runs in milliseconds.
- Is 3DDFA open source?
- Yes — cleardusk/3DDFA is open source, released under the MIT license.
- What language is 3DDFA written in?
- cleardusk/3DDFA is primarily written in Python.
- How popular is 3DDFA?
- cleardusk/3DDFA has 3.7k stars on GitHub.
- Where can I find 3DDFA?
- cleardusk/3DDFA is on GitHub at https://github.com/cleardusk/3DDFA.