This repository is the official implementation of Disentangling Writer and Character Styles for Handwriting Generation (CVPR 2023)
This repository is the official implementation of Disentangling Writer and Character Styles for Handwriting Generation (CVPR 2023)
ArXiv | Poster | Video | Project
Overview of our SDT
Three samples of online characters with writing orders
Online Chinese handwriting generation
Applications to various scripts
Extension on offline Chinese handwriting generation
conda create -n sdt python=3.8 -y
conda activate sdt
# install all dependencies
conda env create -f environment.yml…We provide Chinese, Japanese and English datasets in Google Drive | Baidu Netdisk PW:xu9u. Please download these datasets, uzip them and move the extracted files to /data.
| Model | Google Drive | Baidu Netdisk |
|---|---|---|
| Well-trained SDT | Google Drive | Baidu Netdisk |
| Content encoder | Google Drive | Baidu Netdisk |
| Content Score | Google Drive | Baidu Netdisk |
| Style Score | Google Drive | Baidu Netdisk |
Note: Please download these weights, and move them to /model_zoo.
Training
python train.py --cfg configs/CHINESE_CASIA.yml --log Chinese_logpython train.py --cfg configs/Japanese_TUATHANDS.yml --log Japanese_logpython train.py --cfg configs/English_CASIA.yml --log English_logQualitative Test
python test.py --pretrained_model checkpoint_path --store_type online --sample_size 500 --dir Generated/Chinesepython test.py --pretrained_model checkpoint_path --store_type offline --sample_size 500 --dir Generated_img/Chinesepython test.py --pretrained_model checkpoint_path --store_type online --sample_size 500 --dir Generated/Japanesepython test.py --pretrained_model checkpoint_path --store_type offline --sample_size 500 --dir Generated_img/Japanesepython test.py --pretrained_model checkpoint_path --store_type online --sample_size 500 --dir Generated/Englishpython test.py --pretrained_model checkpoint_path --store_type offline --sample_size 500 --dir Generated_img/EnglishQuantitative Evaluation
data_path to the path of the generated handwritings (e.g., Generated/Chinese), and run this command:python evaluate.py --data_path Generated/Chinese --metric DTWdata_path to the path of the generated handwritings (e.g., Generated/Chinese), and run this command:python evaluate.py --data_path Generated/Chinese --metric Content_score --pretrained_model model_zoo/chinese_content_iter30k_acc95.pthdata_path to the path of the generated handwriting images (e.g., Generated_img/Chinese), and run this command:python evaluate.py --data_path Generated_img/Chinese --metric Style_score --pretrained_model models_zoo/chinese_style_iter60k_acc999.pthWe are delighted to discover that P0etry-rain has proposed a pipeline that involves initially converting the generated results by our SDT to TTF format, followed by the development of software to enable flexible adjustments in spacing between paragraphs, lines, and characters. Below, we present TTF files, software interface and the printed results. More details can be seen in #78.
TTF File
Software Interface
Printed Results
If you find our work inspiring or use our codebase in your research, please cite our work:
@inproceedings{dai2023disentangling,
title={Disentangling Writer and Character Styles for Handwriting Generation},
author={Dai, Gang and Zhang, Yifan and Wang, Qingfeng and Du, Qing and Yu, Zhuliang and Liu, Zhuoman and Huang, Shuangping},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition,
pages={5977--5986},
year={2023}
}No open issues yet, or sync has not completed.