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:
- Select which model you want to use for predicting a handwritten digit
- Select your stroke width of the digit you draw
- 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 | |||
img | |||
models | |||
src | |||
.gitattributes | |||
.gitignore | |||
README.md | |||
app.py | |||
poetry.lock | |||
pyproject.toml | |||
requirements.txt |