Coder Social home page Coder Social logo

rizasif / tensorflow-character-recognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from navdeeshahuja/tensorflow-character-recognition

0.0 2.0 0.0 129.4 MB

Character Recognition from scratch in TensorFlow using Chars 74k dataset

Python 100.00%

tensorflow-character-recognition's Introduction

TensorFlowTM EngHand predict (recognise handwriting)

Installation & Setup

Overview

This project uses the notMNIST tutorial from the TensorFlow website. The tutorial uses a deep learning model. However the Chars 74k dataset is used for training. Moreover, a GUI is also available for predicting a single handwritten image.

This tensorflow code consists of two scripts:

  1. createModel.py – creates a model model/model.ckpt file based on the tutorial.
  2. predict.py – uses the model.ckpt (beginners tutorial) file to predict the correct integer form a handwritten letter in a .png file.
  3. run.py – uses the Kivy apis to start the GUI.

Dependencies

The following Python libraries are required.

Installing TensorFlow

Of course TensorFlow needs to be installed. The TensorFlow website has a good manual. For windows I would suggest the anaconda version. Moreover, the model is built and tested with Python 3.4.

Installing Kivy

For using the GUI you need Kivy. The Kivy installation guide provides a comprehensive tutorial.

Using the GUI

The easiest way is to start the GUI by running:

$ python run.py

The GUI is self explanatory. First provide an image path and click the predict button. An already trained model will provide results.

The python scripts

In order to use the cmd version of the predictor, the training images are included in the package. The rest is provided below.

Running

Running is based on the steps:

  1. create the model file
  2. create an image file containing a handwritten letter
  3. predict the character

1. create the model file

The easiest way is to cd to the directory where the python files are located. Then run:

python createModel.py

to create the model based on the notMNIST beginners tutorial.

2. create an image file

You have to create a PNG file that contains a handwritten character. The background has to be white and the letter has to be black. Any paint program should be able to do this. Also the image has to be auto cropped so that there is no border around the letter.

3. predict the character

The easiest way again is to put the image file from the previous step (step 2) in the same directory as the python scripts and cd to the directory where the python files are located.

The predict scripts require one argument: the file location of the image file containing the handwritten letter. For example when the image file is test.png’ and is in the same location as the script, run:

python predict.py test.png

The script, predict.py, uses the model.ckpt file created by the createModel.py script.

tensorflow-character-recognition's People

Contributors

rizasif avatar navdeeshahuja avatar

Watchers

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