Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 2.1 KB

README.md

File metadata and controls

53 lines (38 loc) · 2.1 KB

RealTime-DigitRecognition

RealTime DigitRecognition using keras/SVC and pygame.

Description

This is a RealTime-DigitRecognition application which can predict output corresponding to handwritten images. I used SVC(support vector classifier) and sequential model of Keras for creating this predictive model. I trained SVC for 8X8 MNIST dataset, but the accuracy of this model is not good when I run this model on my handwritten images(600X600). It is due to resizing images from 600X600 to 8X8.It is important to get good results so I created a sequential model in keras and traied it on 28X28 MNIST dataset. Now it gives very good result on handwritten digits.

The interface is created by using Pygame. The image preprocessing is the most important in this project which I have done by using Scipy and OpenCV.

Sample Images:

These are some sample images of the handwritten character from mnist dataset.

sample images

Dependencies

This is the list of dependencies for running this application.

  • Skleran
  • Keras
  • tensorflow/theano
  • Opencv
  • Pygame
  • Pandas
  • Numpy
  • Secipy
  • Matplotlib

How to use

  1. Download or clone this repository.

  2. Extract to some location

  3. First, run app.py from RealTime-DigitRecognition folder.
    Now, Pygame window will open. It will look like this.

    Pygame window

  4. Draw the digits on left side of the window and output will appear on right side of the window.

  5. Mouse handling:
    The right button is for resetting screen.
    The left button is for drawing.

Choosing model

Edit in app.py
SVC of sklearn: comment KERARS and uncomment SVC
Sequential model: comment SVC and uncomment KERARS

Pygame window

Demo

Pygame window

Please commit for any changes or bugs :)