source | adjustable stylistic degree of glyph | stylized text | application |
liquid artistic text rendering | smoke artistic text rendering |
This is a pytorch implementation of the paper.
Shuai Yang, Zhangyang Wang, Zhaowen Wang, Ning Xu, Jiaying Liu and Zongming Guo. Controllable Artistic Text Style Transfer via Shape-Matching GAN, accepted by International Conference on Computer Vision (ICCV), 2019.
[Project] | [Paper] | More about artistic text style transfer [Link]
Please consider citing our paper if you find the software useful for your work.
Clone this repo:
git clone https://github.com/TAMU-VITA/ShapeMatchingGAN.git
cd ShapeMatchingGAN/src
Download pre-trained models from [Google Drive] or [Baidu Cloud](code:rjpi) to ../save/
Artisic text style transfer using fire style with scale 0.0
../output/
python test.py \
--scale 0.0
--structure_model ../save/fire-GS-iccv.ckpt \
--texture_model ../save/fire-GT-iccv.ckpt \
--gpu
python test.py \
--text_name ../data/rawtext/yaheiB/val/0801.png \
--scale -1 --scale_step 0.2 \
--structure_model ../save/fire-GS-iccv.ckpt \
--texture_model ../save/fire-GT-iccv.ckpt \
--result_dir ../output --name fire-0801 \
--gpu
or just modifying and running
sh ../script/launch_test.sh
--text_type 1
Download text dataset from [Google Drive] or [Baidu Cloud](code:rjpi) to ../data/
Train G_B with default parameters
python trainSketchModule.py \
--text_path ../data/rawtext/yaheiB/train --text_datasize 708 \
--augment_text_path ../data/rawtext/augment --augment_text_datasize 5 \
--batchsize 16 --Btraining_num 12800 \
--save_GB_name ../save/GB.ckpt \
--gpu
or just modifying and running
sh ../script/launch_SketchModule.sh
Saved model can be found at ../save/
Use --help
to view more training options
python trainSketchModule.py --help
--Sanglejitter
will be a good option
python trainStructureTransfer.py \
--style_name ../data/style/fire.png \
--batchsize 16 --Straining_num 2560 \
--step1_epochs 30 --step2_epochs 40 --step3_epochs 80 \
--scale_num 4 \
--Sanglejitter \
--save_path ../save --save_name fire \
--gpu
or just modifying and running
sh ../script/launch_ShapeMGAN_structure.sh
Saved model can be found at ../save/
--glyph_preserve
--text_path ../data/rawtext/yaheiB/train
and --text_datasize 708
--load_GB_name ../save/GB-iccv.ckpt
--glyph_preserve
is not necessary, since one can alternatively use a smaller l--help
to view more training options
python trainStructureTransfer.py --help
--Tanglejitter
will be a good option
python trainTextureTransfer.py \
--style_name ../data/style/fire.png \
--batchsize 4 --Ttraining_num 800 \
--texture_step1_epochs 40 \
--Tanglejitter \
--save_path ../save --save_name fire \
--gpu
or just modifying and running
sh ../script/launch_ShapeMGAN_texture.sh
Saved model can be found at ../save/
--style_loss
--text_path ../data/rawtext/yaheiB/train
and --text_datasize 708
--load_GS_name ../save/fire-GS.ckpt
--style_loss
can slightly improve the texture details--help
to view more training options
python trainTextureTransfer.py --help
Three training examples are in the IPythonNotebook ShapeMatchingGAN.ipynb
Have fun :-)
../data/style/
and copy the result to ../data/style/
.Shuai Yang
williamyang@pku.edu.cn