papulke / face-of-art

Code for "The Face of Art: Landmark Detection and Geometric Style in Portraits"
MIT License
261 stars 31 forks source link

The Face of Art: Landmark Detection and Geometric Style in Portraits

Code for the landmark detection framework described in The Face of Art: Landmark Detection and Geometric Style in Portraits (SIGGRAPH 2019)

Top: landmark detection results on artistic portraits with different styles allows to define the geometric style of an artist. Bottom: results of the style transfer of portraits using various artists' geometric style, including Amedeo Modigliani, Pablo Picasso, Margaret Keane, Fernand Léger, and Tsuguharu Foujita. Top right portrait is from 'Woman with Peanuts,' ©1962, Estate of Roy Lichtenstein.

Getting Started

Requirements

Download

Model

download model weights from here.

Datasets

Create a virtual environment and install the following:

for python 2:

conda create -n foa_env python=2.7 anaconda
source activate foa_env
conda install -c menpo opencv
conda install -c menpo menpo
conda install -c menpo menpofit
pip install tensorflow-gpu

for python 3:

conda create -n foa_env python=3.5 anaconda
source activate foa_env
conda install -c menpo opencv
conda install -c menpo menpo
conda install -c menpo menpofit
pip3 install tensorflow-gpu

Clone repository:

git clone https://github.com/papulke/deep_face_heatmaps

Instructions

Training

To train the network you need to run train_heatmaps_network.py

example for training a model with texture augmentation (100% of images) and geometric augmentation (~70% of images):

python train_heatmaps_network.py --output_dir='test_artistic_aug' --augment_geom=True \
--augment_texture=True --p_texture=1. --p_geom=0.7

Testing

For using the detection framework to predict landmarks, run the script predict_landmarks.py

Acknowledgments