Git Product home page Git Product logo

handwriting-recognition's Introduction

Handwriting Recognition

Software to recognize handwriting. Uses EMNIST dataset for training.

See Python README for more details.

Screenshots

Python






Android

Checklist

  • Recognize digit
  • Recognize letter
  • Recognize multiple digits
  • Recognize multiple letters
  • Recognize continuous handwriting
  • Recognize different languages
  • Android app support

How to run

For dataset creation - python dataset.py
For training - python model.py
For drawing and predicting - python drawer.py
For Android (UNTESTED IN RELEASE 3.0) - python hr_py.py then install app_debug.apk in your phone, open app, draw digit and click Predict

License

Copyright 2016 Samkit Jain

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

handwriting-recognition's People

Contributors

samkit-jain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

handwriting-recognition's Issues

name error canvas is not defined

from tkinter import *

tk = Tk()
canvas = canvas(tk, width=500, height= 400)
tk.title("drawing")
canvas.pack()

canvas.mainloop()

please find the issue why it shows the name error :
canvas is not defined.

OSError: [Errno 24] Too many open files:

I'm running this program on windows, and I'm encountering this issue when I run the dataset.py file.

Setting up EMNIST dataset
Downloading file from https://www.itl.nist.gov/iaui/vip/cs_links/EMNIST/gzip.zip and saving to D:\Coding\Python\Handwriting-Recognition-master\Python\download\gzip.zip
Extracting D:\Coding\Python\Handwriting-Recognition-master\Python\download\gzip.zip
Extracting D:\Coding\Python\Handwriting-Recognition-master\Python\download\gzip\emnist-balanced-train-images-idx3-ubyte.gz
Extracting D:\Coding\Python\Handwriting-Recognition-master\Python\download\gzip\emnist-balanced-train-labels-idx1-ubyte.gz
Extracting D:\Coding\Python\Handwriting-Recognition-master\Python\download\gzip\emnist-balanced-test-images-idx3-ubyte.gz
Extracting D:\Coding\Python\Handwriting-Recognition-master\Python\download\gzip\emnist-balanced-test-labels-idx1-ubyte.gz
Converting D:\Coding\Python\Handwriting-Recognition-master\Python\download\gzip\emnist-balanced-train-images-idx3-ubyte to image files
Traceback (most recent call last):
  File "D:/Coding/Python/Handwriting-Recognition-master/Python/dataset.py", line 221, in <module>
    creator.create()
  File "D:/Coding/Python/Handwriting-Recognition-master/Python/dataset.py", line 95, in create
    label_mapping=label_mapping
  File "D:/Coding/Python/Handwriting-Recognition-master/Python/dataset.py", line 177, in idx_to_image
    image_dest = tempfile.mkstemp(dir=label_folder, suffix='.png')[1]
  File "C:\Users\hsjee\AppData\Local\Programs\Python\Python37\lib\tempfile.py", line 340, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "C:\Users\hsjee\AppData\Local\Programs\Python\Python37\lib\tempfile.py", line 258, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
OSError: [Errno 24] Too many open files: 'D:\\Coding\\Python\\Handwriting-Recognition-master\\Python\\data\\n\\tmp9gd3zyow.png'

Process finished with exit code 1

ValueError: Expected n_neighbors <= n_samples, but n_samples = 1, n_neighbors = 165

Enter choice - 2
Traceback (most recent call last):

File "", line 164, in
recognise_letter()

File "", line 136, in recognise_letter
plt.title('letter is ' + clf.predict([gray_letter])[0])

File "C:\Users\DELL\Anaconda3\lib\site-packages\sklearn\neighbors\classification.py", line 145, in predict
neigh_dist, neigh_ind = self.kneighbors(X)

File "C:\Users\DELL\Anaconda3\lib\site-packages\sklearn\neighbors\base.py", line 347, in kneighbors
(train_size, n_neighbors)

ValueError: Expected n_neighbors <= n_samples, but n_samples = 1, n_neighbors = 165

NameError: name 'Canvas' is not defined

Enter choice - 1
1
<1> Calculate accuracy
<2> Recognize letter
<3> Train again
Exit

Enter choice - 2
Traceback (most recent call last):

File "", line 164, in
recognise_letter()

File "", line 115, in recognise_letter
letter_loc = get_image_src()

File "E:\Shezartech\OCR\English\Handwriting-Recognition-master\Python\painte.py", line 71, in get_image_src
init_set()

File "E:\Shezartech\OCR\English\Handwriting-Recognition-master\Python\painte.py", line 37, in init_set
w = Canvas(master, width=canvas_width, height=canvas_height + 20)

NameError: name 'Canvas' is not defined

Problem with prediction in letters

Hello Sir,
in letter_recognition.py it is predicting letter "l" for every letter drawn. Help me with this.
For making the fs2 directory, I have used the images in NIST dataset (using images from train folder given for each character in NIST dataset) from the link you have provided earlier in another issue.

fs2 dir

helllo , please share fs2 dir

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.