• Stars
    star
    127
  • Rank 281,165 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated 22 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Learning Flow-based Feature Warping for Face Frontalization with Illumination Inconsistent Supervision (ECCV 2020).

Learning Flow-based Feature Warping For Face Frontalization with Illumination Inconsistent Supervision

The source code for our paper "Learning Flow-based Feature Warping For Face Frontalization with Illumination Inconsistent Supervision" (ECCV 2020)

network

Quick Start

Installation

Prerequisites

- python3.7
- pytorch1.5.0 + torchvision0.6.0
- CUDA
- opencv-python
- numpy
- tensorboardX
- tqdm

Conda installation

# 1. Create a conda virtual environment.
conda create -n ffwm python=3.7 anaconda
source activate ffwm

# 2. Install the pytorch 
conda install pytorch==1.5.0 torchvision==0.6.0 cudatoolkit=9.2 -c pytorch

# 3. Install dependency
pip install -r requirements.txt

# 4. Build pytorch Custom CUDA Extensions, we have tested it on pytorch1.5.0+cu92
bash setup.sh

Data Preparation

You can use the scripts in data_process to prepare your data.

The data folder is structured as follows:

dataset
    โ”œโ”€โ”€ multipie
    โ”‚       โ”œโ”€โ”€ train
    โ”‚       โ”‚     โ”œโ”€โ”€ images
    โ”‚       โ”‚     โ”œโ”€โ”€ masks
    โ”‚       โ”‚     โ””โ”€โ”€ landmarks.npy
    โ”‚       โ””โ”€โ”€ test
    โ”‚             โ”œโ”€โ”€ images
    โ”‚             โ”œโ”€โ”€ gallery_list.npy (optional)
    โ”‚             โ””โ”€โ”€ visual_list.npy (optional)
    โ””โ”€โ”€ lfw
         โ”œโ”€โ”€ images
         โ””โ”€โ”€ pairs.txt

Our test gallery_list.npy and visual_list.npy can download from GoogleDrive or BaiduNetDisk (l98p).

Testing

Download the models from GoogleDrive or BaiduNetDisk (l98p) to ./checkpoints folder or use your pretrained models. The models are structured as follows:

./checkpoints
      โ”œโ”€โ”€ ffwm
      โ”‚       โ”œโ”€โ”€ latest_net_flowNetF.pth
      โ”‚       โ””โ”€โ”€ latest_net_netG.pth
      โ”œโ”€โ”€ lightCNN_10_checkpoint.pth (pretrained)
      โ””โ”€โ”€ LightCNN_29Layers_checkpoint.pth (original)

Test on MultiPIE

python test_ffwm.py \
            --dataroot path/to/dataset \
            --lightcnn path/to/pretrained lightcnn \
            --preload 

Test on LFW

python test_ffwm.py \
            --datamode lfw \
            --dataroot path/to/dataset \
            --lightcnn path/to/pretrained lightcnn \
            --preload 

Training

1. Finetune LightCNN

cd lightcnn
python finetune.py \
            --save_path ../checkpoints/ \
            --dataroot path/to/dataset/multipie \
            --model_path path/to/original lightcnn \
            --preload

You can download the original LightCNN model from LightCNN. Or you can download the original and our pretrained LightCNN from GoogleDrive or BaiduNetDisk (l98p).

2. Train Forward FlowNet

python train_flow.py \
            --model flownet \
            --dataroot path/to/dataset \
            --aug \
            --preload \
            --name flownetf \
            --batch_size 6

3. Train Reverse FlowNet

python train_flow.py \
            --model flownet \
            --reverse \
            --dataroot path/to/dataset \
            --aug \
            --preload \
            --name flownetb \
            --batch_size 6

4. Train FFWM

python train_ffwm.py \
                --name ffwm  \
                --preload \
                --dataroot path/to/dataset \
                --lightcnn path/to/pretrained lightcnn 

Citation

If you find our work useful in your research or publication, please cite:

@InProceedings{wei2020ffwm,
  author = {Wei, Yuxiang and Liu, Ming and Wang, Haolin and Zhu, Ruifeng and Hu, Guosheng and Zuo, Wangmeng},
  title = {Learning Flow-based Feature Warping For Face Frontalization with Illumination Inconsistent Supervision},
  booktitle = {Proceedings of the European Conference on Computer Vision},
  year = {2020}
}

More Repositories

1

ELITE

ELITE: Encoding Visual Concepts into Textual Embeddings for Customized Text-to-Image Generation (ICCV 2023, Oral)
Python
503
star
2

StudentScoreManagerSystem

ๅญฆ็”Ÿๆˆ็ปฉ็ฎก็†็ณป็ปŸ ๅคงไธ€็š„C่ฏญ่จ€ๅคงไฝœไธš
C
187
star
3

MasterWeaver

MasterWeaver: Taming Editability and Face Identity for Personalized Text-to-Image Generation (ECCV 2024)
Python
110
star
4

OroJaR

Orthogonal Jacobian Regularization for Unsupervised Disentanglement in Image Generation (ICCV 2021)
Python
68
star
5

iPOSE

Inferring and Leveraging Parts from Object Shape for Improving Semantic Image Synthesis (CVPR 2023)
16
star
6

GBN-Client-Server

ๅฏ้ ๆ•ฐๆฎไผ ่พ“ๅ่ฎฎ-GBN ๅ่ฎฎ็š„่ฎพ่ฎกไธŽๅฎž็Žฐ
Python
12
star
7

Digital-Logic-Design-Experiment

ๆ•ฐๅญ—้€ป่พ‘ๅฎž้ชŒไฝœไธš
Verilog
11
star
8

AnswerApp

An answer app
Java
11
star
9

DeepLearning

HIT-2019Spring-PRDL Lab
Python
9
star
10

Y86-SEQ-CPU

HIT-2017Fall-CSAPP Project: A Y86-SEQ-CPU
Verilog
7
star
11

Digital-Image-Processing-Experiments

2018-HIT-่ง†ๅฌ่ง‰ไฟกๅทๅค„็†่ง†่ง‰้ƒจๅˆ†ๅฎž้ชŒ
Python
7
star
12

Deep-Learning-Learn

ไธ€ไบ›ๆทฑๅบฆๅญฆไน ๅ…ฅ้—จๆ•™็จ‹
4
star
13

MachineLearning

2018-HIT-ๆœบๅ™จๅญฆไน ๅฎž้ชŒ
Python
4
star
14

HTTP-Proxy-Server

Java
3
star
15

DLProject

Python
2
star
16

crawler-learning

Some code for learning python crawler
Python
2
star
17

Android

Android Notes
Java
2
star