Git Product home page Git Product logo

face_segmentation's Introduction

Deep face segmentation in extremely hard conditions

alt text
COFW sample images segmented using our method.

Yuval Nirkin, Iacopo Masi, Anh Tuan Tran, Tal Hassner, and Gerard Medioni.

News (10/07/18)

  • New FCN model released for lower resolution images (300X300), trained without augmentations. Useful if you have limited GPU memory.
  • A better performing and more efficient U-Net model will be released soon, including training and inference scripts using PyTorch.

Overview

This project provides an interface for face segmentation using Caffe with a fully convolutional neural network. The network was trained on IARPA Janus CS2 dataset (excluding subjects that are also in LFW) using a novel process for collecting ground truth face segmentations, involving our tool for semi-supervised Face video segmentation. Additional synthetic images were generated by augmenting hands from the EgoHands dataset, and augmenting 3D models of glasses and microphones.

If you find this code useful, please make sure to cite our paper in your work:

Yuval Nirkin, Iacopo Masi, Anh Tuan Tran, Tal Hassner, Gerard Medioni, "On Face Segmentation, Face Swapping, and Face Perception", IEEE Conference on Automatic Face and Gesture Recognition (FG), Xi'an, China on May 2018

Installation

Download the face_seg_fcn8s.zip or face_seg_fcn8s_300_no_aug.zip and extract to "data" in the installation directory.

Docker Inference

build docker, then run it for inference.

--input argument can be a single image path or a directory path

GPU

Build the docker image

docker build -t face_segmentation:gpu .

Run the docker image

nvidia-docker run -it -v /path/to/face_segmentation:/workspace/face_segmentation face_segmentation:gpu --input ./input

CPU

If you want build cpu version of docker, first go to ./Dockerfile, comment first line and uncomment second line.

Build the docker image

docker build -t face_segmentation:cpu .

Run the docker image

docker run -it -v /path/to/face_segmentation:/workspace/face_segmentation face_segmentation:cpu --input ./input

Note: The segmentation model was trained by cropping the training images using find_face_landmarks. For best results crop the input images the same way, with crop resolution below 350 X 350. A Matlab function is available here.

Citation

Please cite our paper with the following bibtex if you use our face segmentation network:

@inproceedings{nirkin2018_faceswap,
      title={On Face Segmentation, Face Swapping, and Face Perception},
      booktitle = {IEEE Conference on Automatic Face and Gesture Recognition},
      author={Nirkin, Yuval and Masi, Iacopo and Tran, Anh Tuan and Hassner, Tal and Medioni, and G\'{e}rard Medioni},
      year={2018},
    }

Related projects

Copyright

Copyright 2017, Yuval Nirkin, Iacopo Masi, Anh Tuan Tran, Tal Hassner, and Gerard Medioni

The SOFTWARE provided in this page is provided "as is", without any guarantee made as to its suitability or fitness for any particular use. It may contain bugs, so use of this tool is at your own risk. We take no responsibility for any damage of any sort that may unintentionally be caused through its use.

face_segmentation's People

Contributors

iacopomasi avatar kingo233 avatar sajjadaemmi avatar talhassner avatar yuvalnirkin 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.