📦 songquanpeng / font-sr

基于 GAN 的字体图片超分辨. Super resoluation for font images based on GANs.

4 stars 0 forks 👁 4 watching ⚖️ Other
📥 Clone https://github.com/songquanpeng/font-sr.git
HTTPS git clone https://github.com/songquanpeng/font-sr.git
SSH git clone git@github.com:songquanpeng/font-sr.git
CLI gh repo clone songquanpeng/font-sr
Loading files...
📄 README.md

字体超分辨

超分辨模糊的字体图片,使其清晰没有锯齿。

超分辨前 超分辨后

使用步骤

准备数据集

  • 准备一些 ttf 字体文件,放到 archive/ttf_10 下面。
  • 运行脚本生成数据集:python generate_dataset.py

训练模型

python train.py --dataroot ./archive/FONT_SR_64to256_ttf_10_test3 \
--name super_font_cyclegan --model cycle_gan

进行推断

python infer.py --name super_font_cyclegan --model cycle_gan \
--dataroot data_path

后处理

二值化,并转成 RGBA 图片:python post_process.py

其他

代码基于:https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix