This PyQt GUI uses a deep neural network classifier trained on MNIST dataset to classify custom hand-written images in real time. The user can use mouse input to scribble a digit and the GUI will try to classify the image as soon as the user lifts the mouse.
-
Python 3.5.0
-
TensorFlow 1.1.0
-
Scipy 0.19.0
-
Numpy 1.12.1+mkl
-
PyQt5
-
skim age
Import all files in a project in PyCharm. Then run main.py file.
-
main.py: contains all the code to to load and run the trained classifier. It also contains code for the GUI itself.
-
model*: These are all the files of the trained deep neural network. main.py loads this trained classifier at startup.
-
my_gui.ui: If you want to make any changes in the GUI’s front end, this is the file you should edit in the PyQt designer. This file is in XML format and must be converted into Python for subsequent use in main.py file.
-
generate_py_file_ui_file.bat and my_gui.py: Clicking the bat file will convert the my_gui.ui file into my_gui.py file. The my_gui.py file contains Python code for GUI’s front end
-
generate_py_file_qrc_file.bat and resources.qrc file: Any icons used in the GUI must be placed in the icons folder and these icons should then be defined in the resources.qrc file. Then a Python file (resources_rc.py) must be generated by running the generate_py_file_qrc_file.bat file
-
img.png contains the raw high-resolution image obtained from the scribble input
-
img28_inv.png contains the a 28x28 inverted version of the original scribble image. This is used as input to the classifier to classify.
-
pyrcc5.exe is needed to convert the resources.qrc file to resources_rc.py file when the generate_py_file_from_qrc_file.bat is run.