Giter VIP home page Giter VIP logo

dg-font's Introduction

DG-Font: Deformable Generative Networks for Unsupervised Font Generation

The source code for 'DG-Font: Deformable Generative Networks for Unsupervised Font Generation', by Yangchen Xie, Xinyuan Chen, Li sun and Yue lu. The paper was accepted by CVPR2021.

Arvix version

Note

Note that the current repo only works with 80x80 resolution images. An improved version of DGFont is coming soon, which will also fit 128x128 and 256x256 resolution images.

Gallery

image image

Dependencies

Libarary

pytorch (>=1.0)
tqdm  
numpy
opencv-python  
scipy  
sklearn
matplotlib  
pillow  
tensorboardX 

DCN

please refer to https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/tree/pytorch_1.0.0 to install the dependencies of deformable convolution.

Dataset

方正字库 provides free font download for non-commercial users.

Example directory hierarchy

Project
|--- DG-Font
|          |--- font2img.py    
|          |--- main.py
|          |--- train
|                 |--- train.py
|
|--- data
       |--- font1
       |--- font2
             |--- 0000.png
             |--- 0001.png
             |--- ...
       |--- ...

How to run

prepare dataset

python font2img.py --ttf_path ttf_folder --chara character.txt --save_path save_folder --img_size 80 --chara_size CHARACTERSIZE

train

python main.py --gpu GPU_ID --img_size 80 --data_path /path/to --output_k CLASS_NUM --batch_size BATCHSIZE --val_num TEST_IMGS_NUM_FOR_EACH_CLASS

test

python main.py --gpu GPU_ID --img_size 80 --data_path /path/to --output_k CLASS_NUM --batch_size BATCHSIZE --validation --load_model $DIR_TO_LOAD

Acknowledgements

We would like to thank Johnson yue and 上海驿创信息技术有限公司 for their advices in code. Our code is based on TUNIT.

Bibtex

@inproceedings{DG-Font,
    title={DG-Font: Deformable Generative Networks for Unsupervised Font Generation},
    author={Yangchen Xie, Xinyuan Chen, Li sun, Yue lu},
    booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
    year={2021}
}

dg-font's People

Contributors

ecnuycxie avatar fantast616 avatar

Stargazers

 avatar  avatar ZJUHaven avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.