Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Learning Chinese Character style with conditional GAN
| Date | Stars |
|---|---|
| 2026-07-24 | 2742 |
| 2026-07-25 | 2742 |
| 2026-07-28 | 2742 |
| 2026-07-30 | 2742 |
| 2026-08-06 | 2742 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# zi2zi: Master Chinese Calligraphy with Conditional Adversarial Networks
<p align="center">
<img src="assets/intro.gif" alt="animation", style="width: 350px;"/>
</p>
## Introduction
Learning eastern asian language typefaces with GAN. zi2zi(字到字, meaning from character to character) is an application and extension of the recent popular [pix2pix](https://github.com/phillipi/pix2pix) model to Chinese characters.
Details could be found in this [**blog post**](https://kaonashi-tyc.github.io/2017/04/06/zi2zi.html).
## Network Structure
### Original Model

The network structure is based off pix2pix with the addition of category embedding and two other losses, category loss and constant loss, from [AC-GAN](https://arxiv.org/abs/1610.09585) and [DTN](https://arxiv.org/abs/1611.02200) respectively.
### Updated Model with Label Shuffling

After sufficient training, **d_loss** will drop to near zero, and the model's performance plateaued. **Label Shuffling** mitigate this problem by presenting new challenges to the model.
Specifically, within a given minibatch, for the same set of source characters, we generate two sets of target characters: one with correct embedding labels, the other with the shuffled labels. The shuffled set likely will not have the corresponding target images to compute **L1\_Loss**, but can be used as a good source for all other losses, forcing the model to further generalize beyond the limited set of provided examples. Empirically, label shuffling improves the model's generalization on unseen data with better details, and decrease the required number of characters.
You can enable label shuffling by setting **flip_labels=1** option in **train.py** script. It is recommended that you enable this after **d_loss** flatlines around zero, for further tuning.
## Gallery
### Compare with Ground Truth
<p align="center">
<img src="assets/compare3.png" alt="compare" width="600"/>
</p>
### Brush Writing Fonts
<p align="center">
<img src="assets/cj_mix.png" alt="brush" width="600"/>
</p>
### Cursive Script (Requested by SNS audience)
<p align="center">
<img src="assets/cursive.png" alt="cursive" width="600"/>
</p>
### Mingchao Style (宋体/明朝体)
<p align="center">
<img src="assets/mingchao4.png" alt="gaussian" width="600"/>
</p>
### Korean
<p align="center">
<img src="assets/kr_mix_v2.png" alt="korean" width="600"/>
</p>
### Interpolation
<p align="center">
<img src="assets/transition.png" alt="animation", width="600"/>
</p>
### Animation
<p align="center">
<img src="assets/poem.gif" alt="animation", width="250"/>
<img src="assets/ko_wiki.gif" alt="animation", width="250"/>
</p>
<p align="center">
<img src="assets/reddit_bonus_humor_easter_egg.gif" alt="easter egg" width="300"/>
</p>
## How to Use
### Step Zero
Download tons of fonts as you please
### Requirement
* Python 2.7
* CUDA
* cudnn
* Tensorflow >= 1.0.1
* Pillow(PIL)
* numpy >= 1.12.1
* scipy >= 0.18.1
* imageio
### Preprocess
To avoid IO bottleneck, preprocessing is necessary to pickle your data into binary and persist in memory during training.
First run the below command to get the font images:
```sh
python font2img.py --src_font=src.ttf
--dst_font=tgt.otf
--charset=CN
--sample_count=1000
--sample_dir=dir
--label=0
--filter=1
--shuffle=1
```
Four default charsets are offered: CN, CN_T(traditional), JP, KR. You can also point it to a one line file, it will generate the images of the characters in it. Note, **filter** option is highly recommended, it will pre sample some characters and filter all the images that have the same hash, usually indicating that character is missing. **label** indicating index in the category embeddings that this font associated with, default to 0.
After obtaining all images, run **package.py** to picklExcerpt of 7,094 characters
Read on GitHubYuchen Tian · Amazon Web Services · United States
4
2
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:80de4071e320f307, topic:deep-learning, topic:tensorflow