All Projects → Yinghao-Li → 3dmm Fitting

Yinghao-Li / 3dmm Fitting

Fit 3DMM to front and side face images simultaneously.

Projects that are alternatives of or similar to 3dmm Fitting

Regularized Linear Autoencoders
Loss Landscapes of Regularized Linear Autoencoders
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Deep Learning
This repository contains Deep Learning examples using Tensorflow. This repository will be useful for Deep Learning starters who find difficulty in understanding the example codes.
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Python Feature Engineering Cookbook
Python Feature Engineering Cookbook, published by Packt
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Download Celeba Hq
Python script to download the celebA-HQ dataset from google drive
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Tutorials
DEPRECATED - DO NOT USE
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Cloud Dataproc
Cloud Dataproc: Samples and Utils
Stars: ✭ 128 (-2.29%)
Mutual labels:  jupyter-notebook
Citylearn
Official reinforcement learning environment for demand response and load shaping
Stars: ✭ 129 (-1.53%)
Mutual labels:  jupyter-notebook
Zerodha live automate trading using ai ml on indian stock market Using Basic Python
Online trading using Artificial Intelligence Machine leaning with basic python on Indian Stock Market, trading using live bots indicator screener and back tester using rest API and websocket 😊
Stars: ✭ 131 (+0%)
Mutual labels:  jupyter-notebook
Sometimes deep sometimes learning
A collection of DL experiments and notes
Stars: ✭ 129 (-1.53%)
Mutual labels:  jupyter-notebook
Data Structures Algorithms Python
This tutorial playlist covers data structures and algorithms in python. Every tutorial has theory behind data structure or an algorithm, BIG O Complexity analysis and exercises that you can practice on.
Stars: ✭ 126 (-3.82%)
Mutual labels:  jupyter-notebook
Waterfall
An easy to use waterfall chart function for Python
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Stldecompose
A Python implementation of Seasonal and Trend decomposition using Loess (STL) for time series data.
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Causalimpact
Python port of CausalImpact R library
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Slides Scipyconf 2018
A repository for public storage of slides given at the 17th Python in Science Conferences (2018)
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Kaggle earthquake challenge
This is the code for the Kaggle Earthquake Challenge by Siraj Raval on Youtube
Stars: ✭ 132 (+0.76%)
Mutual labels:  jupyter-notebook
Object detection demo
How to train an object detection model easy for free
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Cn Machine Learning
https://cn.udacity.com/mlnd/
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook
Sound localization algorithms
Classical algorithms of sound source localization with beamforming, TDOA and high-resolution spectral estimation.
Stars: ✭ 131 (+0%)
Mutual labels:  jupyter-notebook
Densecap
Stars: ✭ 127 (-3.05%)
Mutual labels:  jupyter-notebook
Gocnn
using CNN to do move prediction and board evaluation for the board game Go
Stars: ✭ 130 (-0.76%)
Mutual labels:  jupyter-notebook

3DMM-fitting

This project is designed to fit a 3DMM to a frontal-face picture profile and a profile picture of the same person simultaneously. This is supposed to lead to a more reliable fitting result than the traditional way in which only one frontal face picture is used, since we acquired additional depth information from the extra profile image.

To add more "automation" flavour to the project, We also introduced landmark regression technique to generated landmarks used for 3DMM-fitting. It should be noticed that the frontal face landmark detection technique is quite mature, so we directly used Dlib-Python to realize the function. However, the profile landmark detection has not been introduced as frequently, and there is no available annotated profile database on Internet. After annotating a subset of profile faces of FERET by ourselves, we compared some techniques such as CNN and AAM, and found out AAM gave the best performance on the limited training set. So we eventually chose to use Dlib-Python to do the frontal face landmark regression, profile face bounding box location model generating and profile face detection; and to use AAM provided by menpo project to do the profile landmark regression. However, as the training set is limited, this automatic annotation approach can only be used on profile pictures in FERET dataset. For other profile images, we provided manually marking tools to enable you to annotate them by hand.

The 3D model fitting part is mainly based on eos, a lightweight 3D Morphable Face Model fitting library in modern C++11/14. The 3D morphable model we used is also derived from their project, although we did some modification so that the model can be readily read by Python projects. Please note that if you prefer to do single-view 3D fitting with only one frontal image, comfortable with configurating C++ libraries and have no wish to play with source code, eos project might be a better choice since C++ have much higher performance in speed than Python.

Library requirements

Face detection and landmark regression

For frontal face detection and landmark regression, please refer to Dlib. Usage example can be found at assist\marker.py.

The training of profile detector and profile landmark AAM model is based on Menpo Project. The installation of menpo lib can be found at their webpage. As the project has not been updated for a long time, some of it's library dependency is samewhat out-of-date and maybe conflict with current Python libraries. It is recommended to install their lib in a new conda environment with python 3.5, in case the already installed libs get messed up.

$ conda create -n menpo python=3.5
$ <conda> activate menpo

$ conda install -c menpo menpo
$ conda install -c menpo menpofit
$ conda install -c menpo menpodetect
$ conda install -c menpo menpowidgets

other menpo libs are not used in this project

After installing this, some minor updates and conflict solving are also need to be done to ensure all menpo function works properly. Specifically, jupyter notebook should be updated, and some dependencies of matplotlib such as ipywidgets must be downgraded to show widgets in jupyter notebook properly. If you encounter any problem, please consult Google or raise an issue at GitHub Repository linked at the end of this document.

The code for the training of profile detection model and AAM for profile landmark regression can be found at \test\Menpo-Display.ipynb.

3-D Morphable Model Fitting

You are recommended to go through the fitting procedure with test\Display.ipynb. In the folder data\, two sets of sample images are already given to test the code. These images are from color FERET database. The facial landmarks are saved as pts files with the same name as the pictures. Please note that the frontal-face landmarks are annotated according to the iBug 68 standard but the profile landmarks are annotated in a new way showed as below.

the landmarks of a profile

Not all the landmarks are used in the process of 3D-fitting.

The frontal face image is automatically annotated with Dlib library. You can call the frontal_face_marker funtion at assist\marker.py to get a pts file contains the landmarks of the frontal face image. The profile image can be marked automatically or manually according to the image source. You can call the manual_marker fuction at assist\marker.py to do manual mark, as shown in test\Display.ipynb.

Search

test\search.ipynb is a trivial demo of searching a particular contend in all files with a particular suffix in all the subfolders of a particular path. This function is mainly to make my research procedure easier and has no special use for this project. But as I kept it I feel obliged to introduce its function. And so it is.

.py in test\ folder

They are legacies and not used for the demonstration for this project so I do not guarantee their functionality. I strongly suggest you not to waste your time on them.

Demonstration

Run test\fitting_test.py with default imput images, you should get a picture discribes the accuracy of the fitting.

fitting result img

This picture will be saved in the test\ folder, along with the generated 3D model as ply file.

fitting result 3D

Video Demo Link

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].