Giter Site home page Giter Site logo

intelligentmachines / handwriting-synthesis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swechhasingh/handwriting-synthesis

0.0 0.0 0.0 266.95 MB

Implementation of "Generating Sequences With Recurrent Neural Networks" https://arxiv.org/abs/1308.0850

License: MIT License

Python 3.42% Jupyter Notebook 95.29% HTML 1.29% Shell 0.01%

handwriting-synthesis's Introduction

Handwriting generation

This project is a web app (CopyMonkey) which uses machine learning to mimic your handwriting style like a monkey. Have fun generating handwriting in your own style!

Demo: https://youtu.be/Ghsb3w0QACI

The ML model is implemented from "Generating Sequences With Recurrent Neural Networks" by Alex Graves (https://arxiv.org/abs/1308.0850)

How to run the web app on your local machine

git clone https://github.com/swechhachoudhary/Handwriting-synthesis.git
cd Handwriting-synthesis
python3 -m venv hand_gen_env
source hand_gen_env/bin/activate
pip install -r requirements.txt
python main.py

How to train handwriting generation (synthesis) model

python train.py --n_epochs 120 --model synthesis --batch_size 64 --text_req

How to train handwriting prediction model

python train.py --n_epochs 120 --model prediction --batch_size 64

Data description:

There are 2 data files that you need to consider: data.npy and sentences.txt. data.npycontains 6000 sequences of points that correspond to handwritten sentences. sentences.txt contains the corresponding text sentences. You can see an example on how to load and plot an example sentence in example.ipynb. Each handwritten sentence is represented as a 2D array with T rows and 3 columns. T is the number of timesteps. The first column represents whether to interrupt the current stroke (i.e. when the pen is lifted off the paper). The second and third columns represent the relative coordinates of the new point with respect to the last point. Please have a look at the plot_stroke if you want to understand how to plot this sequence.

Unconditional generation.

Generated samples: alt text alt text Samples generated using priming:

  • Prime style text is "medical assistance", text after this is generated by model alt text
  • Prime style text is "something which he is passing on", text after this is generated by model alt text
  • Prime style text is "In Africa Jones hotels spring", text after this is generated by model alt text

Conditional generation.

Generated samples: alt text alt text alt text

handwriting-synthesis's People

Contributors

swechhasingh 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.