This project is aim to accomplish style transfer from human faces to anime / manga / cartoon styles.
Warning
Please note that this model is based on an earlier framework and the code may not be fully cleaned or optimized. It is intended for educational purposes and may not reflect current coding best practices or the most recent model iterations.
- Clone the original swapping-autoencoder-pytorch repo.
- Overwrite the following Python files using the source code from the
/codedirectory:model.py→swapping-autoencoder-pytorch/model.pygenerate.py→swapping-autoencoder-pytorch/generate.pytrain_face_model31.pyortrain_face_model42.py(choose one) →swapping-autoencoder-pytorch/train.py
- The same usage as the original repo.
You can test the models with the Jupyter Notebooks in the /ipynb folder.
Spec |
|
|---|---|
| OS | ubuntu 16.04.5 LTS |
| GPU | NVIDIA RTX 2080 * 4 |
| RAM | >= 32G |
| CUDA | 10.0.130 |
| Nvidia Driver | >= 450.80.02 |
| CuDNN SDK | 7.6.5 (for cuda10.0) |
| nccl | 2.5.6 (for cuda10.0) |
| Python | 3.6.12 |
| tensorlfow | 1.14.0 |
The styles used below are from our training dataset.
The styles used below are randomly collected from the internet.
Mean style denotes the mean of all texture codes of our training styles.
Tx rate = n
tx1 : tx2 = 1-n : n
Unfortunately, our model fail to interpolate structures as it can only be applied to texture semantic style transfer.
Stu rate = n
stu1 : stu2 = 1-n : n
Results with removing backgrounds using removebg.
- Compared methods
- Lighting preservation
Zhu et al. 2020. [paper] [github]
Justin Pinkney. 2020. [web]
- Anime
- Human faces
- Anime
- Images randomly collected from the internet. (Total: 170)
- Human faces
- Images randomly collected from the internet. (Total: 17)
- Images selected from the FFHQ dataset. (Total: 63)
- The related research papers:
- Face cartoonization for pre-processing here.
- The idea of this project is highly inspired from naver-webtoon-faces by bryandlee.
- Our code implementation is based on swapping-autoencoder-pytorch by rosinality.
If you find this work useful for your research, please cite:
< English version >
@mastersthesis{huang2021cartoon,
author={Cheryl Huang},
title={Cartoon Style Transfer in Faces using Generative Adversarial Networks},
school={National Taiwan University of Science and Technology},
year={2021},
note={\url{https://hdl.handle.net/11296/j8jm9n}}
}
< Chinese version >
@mastersthesis{huang2021cartoon,
author={黃竹萱},
title={基於生成對抗網路之臉部卡通風格轉換},
school={國立臺灣科技大學資訊工程研究所},
year={2021},
note={\url{https://hdl.handle.net/11296/j8jm9n}}
}
Copyright © 2021 Cheryl Huang. All rights reserved.

