A robot that writes human like handwriting with the help of a deep learning model.
This project was made in collaboration with Manoj Sharma.
- A deep learning model that could generate human like handwriting from input given as text by the user. It outputs the handwriting as a group of coordinates for each stroke which can be plotted serially to get the whole writing. The model is based on Alex Graves's paper available here.
Files related to the model can be found in the "Model" folder.
1) data_preprocessor.ipynb
This file preprocesses the dataset in the "data" folder. The data that is used here is data/original-xml-part.tar.gz, download the data, extract it and paste it in the "data" folder. This file would parse the data in form in which it could be passed through the model and does the required preprocessing, and finally saves the datasets.
2) data_generator.ipynb
It basically helps in creating batches and passing them to the model during the training process from the preprocessed data stored in "data_parsed" folder.
3) model.ipynb
It is the implementation of the model to be trained on the data we preprocessed. A pretrained ready to use model is added in the "pretrained" folder.
4) write.ipynb
It uses a trained model to generate human like handwriting of the text we feed it as input. A sample output is shown below :
-
The bot is given a bunch of coordinates formatted in a gcode file and it traces those coordinates. It is operated by Arduino.
1) ML_robot.py
This file takes the text from user as input, spits out the corresponding handwriting output as a bunch of coordinates and makes sure that the arduino retrieves the coordinates. Scaling and shifting can also be done here before "plotting" the text in plain paper. A demonstration is shown below :
Input : Rain rain go away
What the robot draws :
- Alex Grave's Handwriting Generation Paper
- Helpful Github repos :
- https://github.com/snowkylin/rnn-handwriting-generation
- https://github.com/Mingpan/handwriting_generation
- Blog by Sam Greydnus.