3D-CariGAN: An End-to-End Solution to 3D Caricature Generation from Normal Face Photos

Overview

3D-CariGAN: An End-to-End Solution to 3D Caricature Generation from Normal Face Photos

This repository contains the source code and dataset for the paper 3D-CariGAN: An End-to-End Solution to 3D Caricature Generation from Normal Face Photos by Zipeng Ye, Mengfei Xia, Yanan Sun, Ran Yi, Minjing Yu, Juyong Zhang, Yu-Kun Lai and Yong-Jin Liu, which is accepted by IEEE Transactions on Visualization and Computer Graphics (TVCG).

This repository contains two parts: dataset and source code.

2D and 3D Caricature Dataset

2D Caricature Dataset

2d_dataset

We collect 5,343 hand-drawn portrait caricature images from Pinterest.com and WebCaricature dataset with facial landmarks extracted by a landmark detector, followed by human interaction for correction if needed.

The 2D dataset is in cari_2D_dataset.zip file.

3D Caricature Dataset

3d_dataset

We use the method to generate 5,343 3D caricature meshes of the same topology. We align the pose of the generated 3D caricature meshes with the pose of a template 3D head using an ICP method, where we use 5 key landmarks in eyes, nose and mouth as the landmarks for ICP. We normalize the coordinates of the 3D caricature mesh vertices by translating the center of meshes to the origin and scaling them to the same size.

The 3D dataset is in cari_3D_dataset.zip file.

3DCariPCA

We use the 3D caricature dataset to build a PCA model. We use sklearn.decomposition.PCA to build 3DCariPCA. The PCA model is pca200_icp.model file. You could use joblib to load the model and use it.

Download

You can download the two datasets and PCA in google drive and BaiduYun (code: 3kz8).

Source Code

Running Environment

Ubuntu 16.04 + Python3.7

You can install the environment directly by using conda env create -f env.yml in conda.

Training

We use our 3D caricature dataset and CelebA-Mask-HQ dataset to train 3D-CariGAN. You could download CelebA-Mask-HQ dataset and then reconstruct their 3D normal heads of all images. The 3D normal heads are for calculating loss.

Inferring

The inferring code is cari_pipeline.py file in pipeline folder. You could train your model or use our pre-trained model.

The pipeline includes two optional sub-program eye_complete and color_complete, which are implemented by C++. You should compile them and then use them. The eye_complete is for completing the eye part of mesh and the color_complete is for texture completion.

Pre-trained Model

You can download pre-trained model latest.pth in google drive and BaiduYun (code: 3kz8). You should put it into ./checkpoints.

Additional notes

Please cite the following paper if the dataset and code help your research:

Citation:

@article{ye2021caricature,
 author = {Ye, Zipeng and Xia, Mengfei and Sun, Yanan and Yi, Ran and Yu, Minjing and Zhang, Juyong and Lai, Yu-Kun and Liu, Yong-Jin},
 title = {3D-CariGAN: An End-to-End Solution to 3D Caricature Generation from Normal Face Photos},
 journal = {IEEE Transactions on Visualization and Computer Graphics},
 year = {2021},
 doi={10.1109/TVCG.2021.3126659},
}

The paper will be published.

You might also like...
Code Release for ICCV 2021 (oral), "AdaFit: Rethinking Learning-based Normal Estimation on Point Clouds"

AdaFit: Rethinking Learning-based Normal Estimation on Point Clouds (ICCV 2021 oral) **Project Page | Arxiv ** Runsong Zhu¹, Yuan Liu², Zhen Dong¹, Te

 Estimating and Exploiting the Aleatoric Uncertainty in Surface Normal Estimation
Estimating and Exploiting the Aleatoric Uncertainty in Surface Normal Estimation

Estimating and Exploiting the Aleatoric Uncertainty in Surface Normal Estimation

An implementation of a discriminant function over a normal distribution to help classify datasets.
An implementation of a discriminant function over a normal distribution to help classify datasets.

CS4044D Machine Learning Assignment 1 By Dev Sony, B180297CS The question, report and source code can be found here. Github Repo Solution 1 Based on t

A simple rest api that classifies pneumonia infection weather it is Normal, Pneumonia Virus or Pneumonia Bacteria from a chest-x-ray image.
A simple rest api that classifies pneumonia infection weather it is Normal, Pneumonia Virus or Pneumonia Bacteria from a chest-x-ray image.

This is a simple rest api that classifies pneumonia infection weather it is Normal, Pneumonia Virus or Pneumonia Bacteria from a chest-x-ray image.

The PyTorch improved version of TPAMI 2017 paper: Face Alignment in Full Pose Range: A 3D Total Solution.
The PyTorch improved version of TPAMI 2017 paper: Face Alignment in Full Pose Range: A 3D Total Solution.

Face Alignment in Full Pose Range: A 3D Total Solution By Jianzhu Guo. [Updates] 2020.8.30: The pre-trained model and code of ECCV-20 are made public

Hcaptcha-challenger - Gracefully face hCaptcha challenge with Yolov5(ONNX) embedded solution
Hcaptcha-challenger - Gracefully face hCaptcha challenge with Yolov5(ONNX) embedded solution

hCaptcha Challenger 🚀 Gracefully face hCaptcha challenge with Yolov5(ONNX) embe

[Open Source].  The improved version of AnimeGAN. Landscape photos/videos to anime
[Open Source]. The improved version of AnimeGAN. Landscape photos/videos to anime

[Open Source]. The improved version of AnimeGAN. Landscape photos/videos to anime

This is a virtual picture dragging application. Users may virtually slide photos across the screen. The distance between the index and middle fingers determines the movement. Smaller distances indicate click and motion, whereas bigger distances indicate only hand movement. Neural network for recognizing the gender of people in photos
Neural network for recognizing the gender of people in photos

Neural Network For Gender Recognition How to test it? Install requirements.txt file using pip install -r requirements.txt command Run nn.py using pyth

Comments
  • meaning of each row in 2d landmark

    meaning of each row in 2d landmark

    Dear 3D-CariGAN team,

    Thank you for sharing this great work with us, I really like it.

    In the cari_2D_dataset.zip landmarks, each txt file contains two columns index. They are the index of each face landmark, right? Could you tell me which part of the face each row represent? Or which format the txt file follow? So I can understand the meaning of each row by myself.

    Thank you for your help.

    Best Wishes,

    Alex

    opened by betterze 2
  • operands could not be broadcast together with shapes (107127,1) (160470,1)

    operands could not be broadcast together with shapes (107127,1) (160470,1)

    I want to reconstruct their 3D normal heads according to the address given in the paper.

    The address is as follows: https://github.com/changhongjian/Deep3DFaceReconstruction-pytorch https://github.com/nabeel3133/combining3Dmorphablemodels

    However, the number of vertices of the face model reconstructed with Deep3dFaceReconstruction is inconsistent with that of face_mean

    opened by WangJYao 0
  • Missing code: get_cari

    Missing code: get_cari

    Hi,

    Thanks for sharing the code,

    I've set up the code following the instructions, I am able to generate NUM.obj and eyeNUM.obj files,

    However the code returns (cari_pipelne.py line 207) before assembling the texture. When I uncomment the return I hit a missing file\function named 'get_cari' (cari_pipelne.py line 184) Any chance to share this function or tell its functionality? Thanks!

    opened by kalipoka 3
Owner
null
Official implementation of "StyleCariGAN: Caricature Generation via StyleGAN Feature Map Modulation" (SIGGRAPH 2021)

StyleCariGAN: Caricature Generation via StyleGAN Feature Map Modulation This repository contains the official PyTorch implementation of the following

Wonjong Jang 270 Dec 30, 2022
🐤 Nix-TTS: An Incredibly Lightweight End-to-End Text-to-Speech Model via Non End-to-End Distillation

?? Nix-TTS An Incredibly Lightweight End-to-End Text-to-Speech Model via Non End-to-End Distillation Rendi Chevi, Radityo Eko Prasojo, Alham Fikri Aji

Rendi Chevi 156 Jan 9, 2023
DVG-Face: Dual Variational Generation for Heterogeneous Face Recognition, TPAMI 2021

DVG-Face: Dual Variational Generation for HFR This repo is a PyTorch implementation of DVG-Face: Dual Variational Generation for Heterogeneous Face Re

null 52 Dec 30, 2022
A large-scale face dataset for face parsing, recognition, generation and editing.

CelebAMask-HQ [Paper] [Demo] CelebAMask-HQ is a large-scale face image dataset that has 30,000 high-resolution face images selected from the CelebA da

switchnorm 1.7k Dec 26, 2022
End-to-end face detection, cropping, norm estimation, and landmark detection in a single onnx model

onnx-facial-lmk-detector End-to-end face detection, cropping, norm estimation, and landmark detection in a single onnx model, model.onnx. Demo You can

atksh 42 Dec 30, 2022
An implementation for `Text2Event: Controllable Sequence-to-Structure Generation for End-to-end Event Extraction`

Text2Event An implementation for Text2Event: Controllable Sequence-to-Structure Generation for End-to-end Event Extraction Please contact Yaojie Lu (@

Roger 153 Jan 7, 2023
PyTorch implementation of SampleRNN: An Unconditional End-to-End Neural Audio Generation Model

samplernn-pytorch A PyTorch implementation of SampleRNN: An Unconditional End-to-End Neural Audio Generation Model. It's based on the reference implem

DeepSound 261 Dec 14, 2022
Xview3 solution - XView3 challenge, 2nd place solution

Xview3, 2nd place solution https://iuu.xview.us/ test split aggregate score publ

Selim Seferbekov 24 Nov 23, 2022
Official code of "R2RNet: Low-light Image Enhancement via Real-low to Real-normal Network."

R2RNet Official code of "R2RNet: Low-light Image Enhancement via Real-low to Real-normal Network." Jiang Hai, Zhu Xuan, Ren Yang, Yutong Hao, Fengzhu

null 77 Dec 24, 2022
Normal Learning in Videos with Attention Prototype Network

Codes_APN Official codes of CVPR21 paper: Normal Learning in Videos with Attention Prototype Network (https://arxiv.org/abs/2108.11055) Overview of ou

null 11 Dec 13, 2022