Skip to content
프로젝트

Grzego/handwriting-generation

GitHub에서 보기

소개

TensorFlow에서 순환 신경망을 사용해 손글씨를 생성하는 구현입니다. Alex Graves의 논문(https://arxiv.org/abs/1308.0850)을 기반으로 합니다.

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
-1
in 7 days
-1
in 15 days
-1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Handwriting generation

Implementation of handwriting generation with use of recurrent neural networks in tensorflow. Based on Alex Graves paper (https://arxiv.org/abs/1308.0850).

How to train a model and generate handwriting

1. Download dataset

First you need to download dataset. This requires you to register on this page ("Download" section). After registration you will be able to download the data/original-xml-part.tar.gz. Unpack it in repository directory.

2. Preprocess dataset

python preprocess.py

This scipt searches local directory for xml files with handwriting data and does some preprocessing like normalizing data and spliting strokes in lines. As a result it should create data directory with preprocessed dataset.

3. Train model

python train.py

This will launch training with default settings (for experimentation look at argparse options). By default it creates summary directory with separate experiment directories for each run. If you want to restore training provide a path to the experiment you want to continue. Like:

python train.py --restore=summary\experiment-0

You can lookup losses in command line or with tensorboard. Example loss plot:

Loss plot

With default settings training took about 5h (using tensorflow 1.2, with GTX 1080).

4. Generate handwriting!

python generate.py --model=path_to_model

When model is trained you can use generate.py scipt to test how it works. Without providing --text argument this script will ask you what to generate in a loop.

Additional options for generation:

  • --bias (float) - with higher bias generated handwriting is more clear so to speak (read paper for more info)
  • --noinfo - plots only generated handwriting (without attention window)
  • --animation - animation of writing
  • --style - style of handwriting, int from 0 to 7 (functionality added thanks to @kristofbc, you can look how each style looks like in imgs folder)

Examples

python generate.py --noinfo --text="this was generated by computer" --bias=1.

example-1

python generate.py --noinfo --animation --text="example of animation " --bias=1.

example-2

Any feedback is welcome :smile:

관련 프로젝트 살펴보기

불러오는 중…