RealTime DigitRecognition using keras/SVC and pygame.
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.
These are some sample images of the handwritten character from mnist dataset.
This is the list of dependencies for running this application.
- Skleran
- Keras
- tensorflow/theano
- Opencv
- Pygame
- Pandas
- Numpy
- Secipy
- Matplotlib
-
Download or clone this repository.
-
Extract to some location
-
First, run
app.py
fromRealTime-DigitRecognition
folder.
Now, Pygame window will open. It will look like this.
-
Draw the digits on left side of the window and output will appear on right side of the window.
-
Mouse handling:
The right button is for resetting screen.
The left button is for drawing.
Edit in app.py
SVC of sklearn: comment KERARS
and uncomment SVC
Sequential model: comment SVC
and uncomment KERARS