ch10tang / fnm.pytorch

A PyTorch implementation of Unsupervised Face Normalization with Extreme Pose and Expression in the Wild
17 stars 2 forks source link

Face Normalization Model

A PyTorch implementation of Unsupervised Face Normalization with Extreme Pose and Expression in the Wild from the paper by Qian, Yichen and Deng, Weihong and Hu, Jiani.

Here are some examples made by fnm.pytorch. Alt text

Pre-requisites --

Datasets

Training and Inference

  1. Colone the Repository to preserve Directory Strcuture.
  2. Download the face expert model, and put the model in /Pretrained/VGGFace2/ directory.
  3. Change the directory to /FaceAlignment/ (cd FaceAlignment), and crop and align the input face images by running:

    python face_align.py

  4. Train the face normalization model by running:

    python main.py -front-list {} -profile-list {}

  5. I also provide a simple test code, which can help to generate the normalized face and extract the features:

    python main.py -generate -gen-list {} -snapshot {your trained model}

Note that, you need to define the csv files of source/normal/generate data roots during training/testing.

To-do list