Giter Club home page Giter Club logo

handwritten's Introduction

Handwritten

Homework could have been so much easier if only it could be submitted as a typed copy.
Using Alex Graves' paper on handwriting generation is a step I liked. This script uses his amazing paper (actually the free service he has set up online) to generate handwritten homework for given text.

Requirements

  • python3.x
  • pip install requests
  • pip install pillow

Or you can do pipenv install --python3

Usage

usage: get_hand.py [-h] (-f FILE | -t TEXT) [-s STYLE] [-b BIAS] [-p POSITION]
                   [-c COLOR]

Plain text to handwriting generator.

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  text file to generate handwriting from (default: None)
  -t TEXT, --text TEXT  text to generate handwriting from (default: None)
  -s STYLE, --style STYLE
                        handwriting style from 0 to 5, where 5 is random style
                        (default: 5)
  -b BIAS, --bias BIAS  handwriting bias from 0.1 to 1 (default: 0.8)
  -p POSITION, --position POSITION
                        start at specific position (default: 0)
  -c COLOR, --color COLOR
                        add custom RGB color values to generated text
                        (default: 0,0,0)

Example

Generating handwritten text page from a file (with no more than 100 characters in each line) with handwriting style 4:

python get_hand.py -f desc.txt -s 4
python make_page.py

Now open pages/1.png:

sample handwriting

Generating handwritten text using a string in blue color & custom bias with handwriting style 2:

python get_hand.py -t "Homework could have been easier" -s 2 -c 0,0,200 -b 0.85

Now open images/0.png:

blue ink

More Info

The paper
The man behind it all. Alex Graves
What I am using

handwritten's People

Contributors

ritiek avatar thesage21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

handwritten's Issues

Issues with getting it to work

However, was getting the below error.

Traceback (most recent call last):
  File "get_hand.py", line 36, in <module>
    if not os.path.exists('images'):
NameError: name 'os' is not defined

so added : import os to the File "get_hand.py"


On running "python make_page.py 20 " the below error is thrown:

Creating pages folder
Traceback (most recent call last):
  File "make_page.py", line 36, in <module>
    for i in range(line_count):
TypeError: 'str' object cannot be interpreted as an integer

Pls. suggest any working solution.

Numbers appear like jargon

The script works great but when ti comes to numbers they appear like scribbles. Is there a work around to include numbers?

Syntax error

Dear developers, I find an error when running the simple example provided in the doc:

python get_hand.py -t "Homework could have been easier" -s 2 -c 0,0,200 -b 0.85

File "get_hand.py", line 51
print('.', end='')
^
SyntaxError: invalid syntax

Do you have any hint?

Best regards,
Antonio

from PIL import Images

Hi I get this error when running python make_page.py
File "make_page.py", line 3, in
from PIL import Images

Any ideas on how to fix it?

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.