Code Monkey home page Code Monkey logo

generalized-face-landmarker's Introduction

Generalizable Face Landmarking Guided by Conditional Face Warping (CVPR 2024)

This is the official repository for the following paper:

Generalizable Face Landmarking Guided by Conditional Face Warping [paper] [arxiv] [project page]

Jiayi Liang*, Haotian Liu*, Hongteng Xu, Dixin Luo
Accepted by CVPR 2024.

Scheme

Install

pip install -r requirements.txt

Model

Our proposed framework mainly contains two parts: face warper and landmark detector. They are trained in an alternative optimization framework.

  • The face warper aims to deform real human faces according to stylized facial images, generating warped faces and corresponding warping fields.
  • The face landmarker, as the key module of the warper, predicts the ending points of the warping fields and thus provides us with pseudo landmarks for the stylized facial images.

In our implmentation, we employ SLPT as our backbone and locate the model in Landmark2 folder. For the reproduction on other detectors, substitute the Landmark2 folder with target model and make modifications in train.py.

Data Preparation

Source Domain

Download images and annotations of 300-W from ibug.

We select frontal faces from the trainset of 300W as our training data, and list of image path 300W_frontal_train_list.txt can be downloaded from Google Drive.

Your directory should be like:

  Dataset
  │
  └──300W
     │
     └───300W_frontal_train_list.txt
     └───frontal_train
         └───261068_1.jpg
         │
         └───...
     └───frontal_train_label
         └───261068_1.jpg.npy
         │
         └───...
     └───test_list.txt
     └───test_list_common.txt
     └───test_list_challenge.txt
     └───lfpw
         └───trainset
         └───testset
             └───image_0001.png
             └───image_0001.pts
             │
             └───...
     └───helen
         │
         └───...
     └───ibug
         │
         └───...

Target Domain

  • Download CariFace according to CariFace Dataset. The split of training and testing set can be downloaded from Google Drive.

  • Other domains like Artistic-Faces can be retrieved from Link. The split of training and testing set can be downloaded from Google Drive.

Please note that ArtiFace contains a total of 160 images. Under the GZSL (Unseen ArtiFace) scenario, the test set size of ArtiFace is 160 images; under the DA (300W->ArtiFace) and GZSL (Unseen CariFace) scenarios, the test set of ArtiFace only contains 32 images.
Therefore, please modify the specified test set list in Artistic.py to test_list.txt (32 images) or test_list_all.txt (160 images) according to the different circumstances.

Your directory should be like:

  Dataset
  │
  └──CariFace_dataset
     │
     └───images
         └───00005.jpg
         │
         └───...
     └───landmarks
         └───00005.jpg.npy
         │
         └───...
     └───train_list.txt
     └───test_list.txt
  │
  └──AF_dataset
     │
     └───images
         └───0.png
         │
         └───...
     └───landmarks
         └───0.png.npy
         │
         └───...
     └───train_list.txt
     └───test_list.txt
     └───test_list_all.txt

Train

Load Pretrained Model

Download source-pretrained weights model_best.pth from Google Drive and move it into folder Landmark2.

Training Begin!

python train.py --src_data path/to/source/data --tgt_data path/to/target/data --pretrain_path path/to/pretrained/checkpoint

Inference

Download our model and test on the CariFace by running:

python test.py --checkpoint path/to/model/weights

Further, to test on ArtiFace, download checkpoint and inference:

python test_Artistic.py --checkpoint path/to/model/weights

Citation

If our work is helpful for your research, please cite our paper:

Aknowledgement

generalized-face-landmarker's People

Contributors

plustwo0 avatar haotianliu123 avatar

Stargazers

최연우(Yonwoo Choi) avatar  avatar  avatar musketeer avatar Faych Chen avatar  avatar Richard Chen avatar  avatar Daniel Puglisi avatar LiangChao avatar  avatar  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.