Giter VIP home page Giter VIP logo

fontrnn's Introduction

FontRNN

This repository contains the implementation in tensorflow of FontRNN described in our paper FontRNN: Generating Large-scale Chinese Fonts via Recurrent Neural Network(Computer Graphics Forum, 2019).

Overview of Paper

Despite the recent impressive development of deep neural networks, using deep learning based methods to generate large-scale Chinese fonts is still a rather challenging task due to the huge number of intricate Chinese glyphs, e.g., the official standard Chinese charset GB18030-2000 consists of 27,533 Chinese characters. Until now, most existing models for this task adopt Convolutional Neural Networks (CNNs) to generate bitmap images of Chinese characters due to CNN based models’ remarkable success in various application fields. However, CNN based models focus more on image-level features while usually ignore stroke order information when writing characters. Instead, we treat Chinese characters as sequences of points (i.e., writing trajectories) and propose to handle this task via an effective Recurrent Neural Network (RNN) model with monotonic attention mechanism, which can learn from as few as hundreds of training samples and then synthesize glyphs for remaining thousands of characters with the same style. Experiments show that our proposed FontRNN can be used for synthesizing large-scale Chinese fonts as well as generating realistic Chinese handwritings efficiently.

Quickstart

code

The code of FontRNN that contains model defination (model.py), training script (train.py) and testing jupyter notebook (test.ipynb).

Some scripts are borrowed from Sketch-RNN.

training example:

CUDA_VISIBLE_DEVICES=0 python train.py -hparams="log_root=../log/demo, batch_size=128, attention_method=LM"

testing:

Make sure training was done before testing. We've provided a simple jupyter notebook (test.ipynb) to show you how to load a trained model and generate the generate results.

data

For copyright reasons, we only provide one font data (FZTLJW.npz) for research (commercial use prohibited), that contains three parts of train, validation and test sets. The train set contains 775 samples described in paper, the remaining samples are randomly divided into validation and test sets.

Requirements

  • python=3.6
  • tensorflow-gpu=1.11.0
  • tensorboard

Citation

If you use this code or data in your research, please cite us as follows:

@inproceedings{tang2019fontrnn,
  title={FontRNN: Generating Large-scale Chinese Fonts via Recurrent Neural Network},
  author={Tang, Shusen and Xia, Zeqing and Lian, Zhouhui and Tang, Yingmin and Xiao, Jianguo},
  booktitle={Computer Graphics Forum},
  volume={38},
  number={7},
  pages={567--577},
  year={2019},
  organization={Wiley Online Library}
}

fontrnn's People

Contributors

shusentang avatar

Watchers

James Cloos 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.