SkillAgentSearch skills...

Faces2Anime

Faces2Anime: Cartoon Style Transfer in Faces using Generative Adversarial Networks. Masters Thesis 2021 @ NTUST.

Install / Use

/learn @CherylHuang/Faces2Anime
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Faces2Anime

Cartoon Style Transfer in Faces using GANs

paper | video | slides

./imgs/results/tx_interpolation.gif ./imgs/results/tx_interpolation.PNG This project is aim to accomplish style transfer from human faces to anime / manga / cartoon styles.

How to Use

[!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.

Train

  1. Clone the original swapping-autoencoder-pytorch repo.
  2. Overwrite the following Python files using the source code from the /code directory:
    • model.pyswapping-autoencoder-pytorch/model.py
    • generate.pyswapping-autoencoder-pytorch/generate.py
    • train_face_model31.py or train_face_model42.py (choose one) → swapping-autoencoder-pytorch/train.py
  3. The same usage as the original repo.

Test

You can test the models with the Jupyter Notebooks in the /ipynb folder.

Trained Models

Virtual Environment Setup (Anaconda)

| <div align="center">Spec</div> | | | :--- | :--- | | 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 |

Results

Trained styles

The styles used below are from our training dataset.

./imgs/results/trained_style.PNG

./imgs/results/trained_style2.PNG

Un-trained styles

The styles used below are randomly collected from the internet.

./imgs/results/un-trained_style.PNG

./imgs/results/un-trained_style2.PNG

Mean style transference

Mean style denotes the mean of all texture codes of our training styles.

./imgs/results/mean_style_transfer.PNG

Texture interpolation

Tx rate = n
tx1 : tx2 = 1-n : n

./imgs/results/tx_interpolation2.PNG

Structure interpolation

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

./imgs/results/stu_interpolation.PNG

<br />

Results with removing backgrounds using removebg.

./imgs/results/stu_interpolation2.PNG

Comparison

./imgs/results/comparison1.PNG

./imgs/results/comparison2.PNG

<br />
  • Lighting preservation

./imgs/results/comparison3.PNG

Further Transformation

In-Domain GAN Inversion for Real Image Editing

Zhu et al. 2020. [paper] [github]

./imgs/results/further_in-domain.PNG

Toonify!

Justin Pinkney. 2020. [web]

./imgs/results/further_toonify.PNG

Datasets

:warning: Warning: All images are only used for research purpose. Prohibited for commercial use.

Training data

  • Anime
    • Images randomly collected from WEBTOON. (Total: 22,741; Titles: 128)
    • Images generated from StyleGAN2 anime pre-train model. (Total: 300)
  • Human faces
    • Images generated from StyleGAN2 FFHQ pre-train model. (Total: 3,802)
    • Celebrity faces selected from the CelebA dataset and randomly collected from the internet. (Total: 1,311)

Testing data

  • 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)

Acknowledgement

BibTeX Citation

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}}
}

License

./imgs/results/Logo-NTUST.png ./imgs/results/Logo-GAMELab.png

Copyright © 2021 Cheryl Huang. All rights reserved.

View on GitHub
GitHub Stars108
CategoryContent
Updated19d ago
Forks6

Languages

Jupyter Notebook

Security Score

85/100

Audited on Mar 20, 2026

No findings