README.md

MNIST Streamlit

This is a simple Streamlit app that demonstrates the differences between neural nets trained on the same dataset (MNIST dataset).

There are two models created and saved locally available in the models directory:

  • mnist_model.keras
  • autokeras_model.keras

The mnist_model.keras is a simple 300x300 neural net while autokeras_model.keras is a more complex model generated by running the Autokeras image classifier class. As these models are stored and versioned on XetHub, you can see their architecture by visiting the file in the repository (mnist_model and autokeras_model).

The third model in the models directory comes from the Open Neural Network Exchange (ONNX). This model, mnist_12.onnx is pre-trained on the MNIST dataset.

The application allows you to:

  1. Select which model you want to use for predicting a handwritten digit
  2. Select your stroke width of the digit you draw
  3. Draw a specific digit within a canvas

Once you draw a digit, the model will be loaded, asked to make a prediction on your input, and provide:

  • The name of the model used to make the prediction
  • A prediction (the top prediction from it's probability distribution)
  • The time the model took to predict
  • The time it took to load the model
  • The probability distribution of predictions as a bar chart and table

Usage

To run the Streamlit app locally, clone the repository, cd into the created directory, and run the following commands:

  • poetry shell
  • poetry install
  • streamlit run app.py

You can also re-train the model by modifying the net in src/training.py and re-running the training by running python training.py (which will save the new model in /models). This will overwrite the existing model and will be used in subsequent runs of the Streamlit app.

File List Total items: 11
Name Last Commit Size Last Modified
.streamlit wrong directory structure for config.toml; updated 3 months ago
img wrapping up app 3 months ago
models wiring in onnx model 2 months ago
src training 3 months ago
.gitattributes Initial commit 79 B 3 months ago
.gitignore initial commit 9 B 3 months ago
README.md minor README modification 1.8 KiB 2 months ago
app.py wiring in onnx model 6.6 KiB 2 months ago
poetry.lock downgrading scipy to work in capsule 192 KiB 2 months ago
pyproject.toml downgrading scipy to work in capsule 578 B 2 months ago
requirements.txt downgrading removing dependencies to load capsule 1.3 KiB 2 months ago

Repository Size

Loading repo size...

Commits 22 commits

File Types