Installing frontalization 0.1.3: Face Frontalization in Unconstrained Images using MATLAB R2015b on Ubuntu 16.04

Library source:

The code uses the following dependencies. You MUST have these installed and available on the MATLAB path:

1. calib-1.0.1 function available from:
Installation: unzip calib.1.0.1, rename it to calib under frontaliztion home directory. Then rename calib_cv2.4.mexa64 to calib.mexa64

2. Facial feature detection functions. The code provides examples
of frontalization using different facial landmark detection methods. Currently supported are:
– SDM (default, used in paper; We don’t use this at the moment ),
– The facial feature detector of Zhu and Ramanan (We don’t use this at the moment)
DLIB detector (Our chosen method) .
– Any sparse (five-point) facial landmark detector. (We don’t use this at the moment)

3. OpenCV required by calib for calibration routines and some of the

detectors for cascase classifiers (We have already discussed about OpenCV installation in other blog posts. Check those.)

Frontalization set up:

1. Setup Dlib: Download from

tar jxvf dlib-19.1.tar.bz2
 cd dlib-19.1/
 cd examples/
cd build/
 cmake ..
 cmake --build . --config Release

2. Install dlib dependency (if required):

sudo apt-get install libboost-python1.58.0

3. Open demo.m

change line 86 from :
 detector = 'SDM'; to detector = 'dlib';

4. Open facial_feature_detection.m

Go to case ‘dlib’

change line 106 to following:
 Model3D = load('model3Ddlib'); % reference 3D points corresponding to dlib detections
 Model3D = Model3D.model_dlib;
and change line 111 to following:
 fidu_XY = load('dlib_xy.mat'); % load detections performed by Python script on current image
 fidu_XY = reshape(fidu_XY.lmarks,68,2);

5. Now open

Comment out line 7:
 #from Utils import HOME
Add the following two lines at the end: (Change image list as you like)
 lmarks, bboxes = get_landmarks(['test.jpg'])
 savemat('dlib_xy.mat', {'lmarks':lmarks})

6. Run the python file, this will create the dlib_xy.mat file

8. Now run demo.m , to see the frontalization demo result.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s