Skip to content

mohtamohit/RealTime-DigitRecognition

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 :)

About

RealTime DigitRecognition using keras/SVC and pygame.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%