python microproject
python microproject
Guido van Rossum began working on Python in the late 1980s as a successor to
the ABC programming language and first released it in 1991 as Python 0.9.0.
Python 2.0 was released in 2000 and introduced new features such as list
comprehensions, cycle-detecting garbage collection, reference counting, and
Unicode support. Python 3.0, released in 2008, was a major revision that is not
completely backward-compatible with earlier versions. Python 2 was
discontinued with version 2.7.18 in 2020.
Micro-Project Proposal-B
For 6th semester
Handwritten digit recognition
Hangman is a guessing game for two or more players. One player thinks
of a word, phrase or sentence and the other(s) tries to guess it by
suggesting letters within a certain number of guesses. Originally a
Paperand-pencil game, there are now electronic versions.
Guido van Rossum began working on Python in the late 1980s as a successor
to the ABC programming language and first released it in 1991 as Python
0.9.0. Python 2.0 was released in 2000 and introduced new features such as
list comprehensions, cycle-detecting garbage collection, reference counting,
and Unicode support. Python 3.0, released in 2008, was a major revision that
is not completely backward-compatible with earlier versions. Python 2 was
discontinued with version 2.7.18 in 2020
Hangman is a guessing game for two or more players. One player thinks of a
word, phrase or sentence and the other(s) tries to guess it by suggesting
letters within a certain number of guesses. Originally a Paper-and-pencil
game, there are now electronic versions.
Keras Module :
Keras is an Open Source Neural Network library written in Python that runs on top of Theano
or Tensorflow. It is designed to be modular, fast and easy to use. It was developed by François
Chollet, a Google engineer. Keras doesn’t handle low-level computation. Instead, it uses another
library to do it, called the “Backend.
Keras is high-level API wrapper for the low-level API, capable of running on top of TensorFlow,
CNTK, or Theano. Keras High-Level API handles the way we make models, defining layers, or
set up multiple input-output models. In this level, Keras also compiles our model with loss and
optimizer functions, training process with fit function. Keras in Python doesn’t handle Low-
Level API such as making the computational graph, making tensors or other variables because it
has been handled by the “backend” engine.
Theano is an open source project that was developed by the MILA group at the University of
Montreal, Quebec, Canada. It was the first widely used Framework. It is a Python library that
helps in multi-dimensional arrays for mathematical operations using Numpy or Scipy. Theano
can use GPUs for faster computation, it also can automatically build symbolic graphs for
computing gradients. On its website, Theano claims that it can recognize numerically unstable
expressions and compute them with more stable algorithms, this is very useful for our unstable
expressions.
On the other hand, Tensorflow is the rising star in deep learning framework. Developed by
Google’s Brain team it is the most popular deep learning tool. With a lot of features, and
researchers contribute to help develop this framework for deep learning purposes.
Another backend engine for Keras is The Microsoft Cognitive Toolkit or CNTK. It is an
opensource deep learning framework that was developed by Microsoft Team. It can run on multi
GPUs or multi-machine for training deep learning model on a massive scale. In some cases,
CNTK was reported faster than other frameworks such as Tensorflow or Theano. Next in this
Keras CNN tutorial, we will compare the backends of Theano, TensorFlow and CNTK.
IDE:
Google colab
model = load_model('mnist.h5')
def predict_digit(img):
#resize image to 28×28 pixels
img = img.resize((28,28))
#convert rgb to grayscale
img = img.convert('L') img =
ImageOps.invert(img) img =
np.array(img)
#reshaping to support our model input and normalizing
img = img.reshape(1,28,28,1) img = img/255.0
#predicting the class
res = model.predict([img])[0]
return np.argmax(res), max(res)
self.x = self.y = 0
#self.canvas.bind("<Motion>", self.start_pos)
self.canvas.bind("<B1-Motion>", self.draw_lines)
def clear_all(self):
self.canvas.delete("all")
def classify_handwriting(self):
HWND = self.canvas.winfo_id() # get the handle of the canvas
rect = win32gui.GetWindowRect(HWND) # get the coordinate of the
canvas
a,b,c,d = rect
rect=(a+4,b+4,c-4,d-4) im =
ImageGrab.grab(rect)
app = App()
mainloop() Output:
Interface of Recognisor :
Conclusion:
The course is designed to provide Basic knowledge of Python. Python
programming is intended for software engineers, system analysts, program
managers and user support personnel who wish to learn the Python
programming language. Learning Outcomes: Problem solving and
programming capability.
Understanding the syntax of Python is great and all, and Python by itself is
indeed a great language, but the fundamentals of Python are why Python is a
successful language.