Coder Social home page Coder Social logo

konatasick / face-of-art Goto Github PK

View Code? Open in Web Editor NEW

This project forked from papulke/face-of-art

0.0 1.0 0.0 27.94 MB

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

License: MIT License

Python 17.28% Jupyter Notebook 82.72% Rich Text Format 0.01%

face-of-art's Introduction

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

  • python
  • anaconda

Download

Model

download model weights from here.

Datasets

  • The datasets used for training and evaluating our model can be found here.

  • The Artistic-Faces dataset can be found here.

  • Training images with texture augmentation can be found here. before applying texture style transfer, the training images were cropped to the ground-truth face bounding-box with 25% margin. To crop training images, run the script crop_training_set.py.

  • our model expects the following directory structure of landmark detection datasets:

landmark_detection_datasets
    ├── training
    ├── test
    ├── challenging
    ├── common
    ├── full
    ├── crop_gt_margin_0.25 (cropped images of training set)
    └── crop_gt_margin_0.25_ns (cropped images of training set + texture style transfer)

Install

Create a virtual environment and install the following:

  • opencv
  • menpo
  • menpofit
  • tensorflow-gpu

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

face-of-art's People

Contributors

konatasick avatar papulke avatar yaelnewman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.