Git Product home page Git Product logo

mnist_draw_test's Introduction

MNIST with UI!

Welcome to Tensorflow MNIST! I started to learn Tensorflow2 a couple of weeks ago. I tried to run the first and famous MNIST learning samples. I was able to get them train CNN based models on my local. It says over 99% accuracy with test images.
But wanted to check how it works with my own handwritings.

Train the model

I used the model described at Martin's tutorial And the final model is saved to models folder

Add the UI

Now I need UI to accept user handwriting. Used Tkinter, PIL frameworks to add a window and hand-drawing panel on it.

Normalize the Images

Drawing on the canvas is resized to 28 x 28 and fed to trained model but the accuracy was below 60%. It couldn't recognize even an clear drawing. So as directed here, I added normalization of images.

The original black and white (bilevel) images from NIST were size normalized to fit in a 20x20 pixel box while preserving their aspect ratio. The resulting images contain grey levels as a result of the anti-aliasing technique used by the normalization algorithm. the images were centered in a 28x28 image by computing the center of mass of the pixels, and translating the image so as to position this point at the center of the 28x28 field.

Pretty high Accuracy

screenshot of hand-drawing panel recognition result

mnist_draw_test's People

Contributors

christiansoe avatar

Stargazers

 avatar

Watchers

 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.