This is a simple demonstrator of an MNIST classifier, with a graphical user interface and a canvas that lets you draw digits and have them classified in real-time.
- Python 3 (3.7.2; make sure the version is compatible TensorFlow)
- TensorFlow (tensorflow-gpu 1.13.1)
- PySide 2 (5.12.3)
- h5py (2.9.0)
The text within parenthesis specifies the versions this repository is known to be compatible with.
To create a Conda environment that fulfills the prerequisites:
conda env create --file environment.yml
To update an already existing environment:
conda env update --file environment.yml
To activate the environment:
conda activate gui-mnist
To deactivate the environment:
conda deactivate
Run the graphical user interface as follows:
$ python gui.py
Draw with the left mouse button and reset the canvas with the right mouse button.
The easiest way to tweak the behavior of the application is currently to change the hardcoded values for the parameters under the options section in gui.py
, as the script currently doesn't take any arguments.
The first time the script is run with a specific model type selected, a new model will be trained from scratch and saved as an HDF5 file in the folder from which the script is run. This file will then be loaded and used the following times the application is run with the same model type selected instead of training a new model.