Skip to main content

A Streamlit component tailored for handwriting digit recognition using the MNIST dataset. This component allows users to draw digits on a canvas, facilitating integration with various machine learning models for digit recognition. It's ideal for educational, development, and testing purposes within Streamlit applications.

Project description

Streamlit MNIST Canvas

Overview

This repository provides a Streamlit component, st_mnist_canvas, designed for creating and recognizing handwritten digits. It's a perfect tool for educational purposes, machine learning model testing, and demonstrations.

Installation

To install Streamlit Oekaki, run the following command:

pip install streamlit-mnist-canvas

Usage

st_mnist_canvas enables users to draw digits in a Streamlit app. The digit can then be displayed and processed, making it highly effective for use with MNIST-trained digit recognition models.

Example

Here's how to get started with st_mnist_canvas:

import streamlit as st
from streamlit_mnist_canvas import st_mnist_canvas
import numpy as np

st.subheader("Input")
result = st_mnist_canvas()

if result.is_submitted:
    st.write("Output")
    st.image(result.resized_grayscale_array, caption="Grayscale 28x28 Image")

    # Prepare the image for ML model prediction
    # image_for_prediction = np.expand_dims(result.resized_grayscale_array, axis=0)

    # Predict digit using a machine learning model
    # Example: prediction = model.predict(image_for_prediction)
    # st.write("Predicted Digit:", prediction)

Integrating with Machine Learning Models
st_mnist_canvas can be directly integrated with ML models, especially those trained on the MNIST dataset. Once a digit is drawn and submitted, the image data, formatted as a 28x28 grayscale array, is ready for input into a pre-trained model. This allows for real-time digit recognition and analysis within your Streamlit app.

Demo

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_mnist_canvas-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_mnist_canvas-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_mnist_canvas-0.1.0.tar.gz.

File metadata

  • Download URL: streamlit_mnist_canvas-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for streamlit_mnist_canvas-0.1.0.tar.gz
Algorithm Hash digest
SHA256 548476a06d77c9eed3acc06db4e87f584a310ad3eb798056ff7bd687d2a0b308
MD5 ad5f887f9c2b9be1103ff594737ba684
BLAKE2b-256 3bc9a9d993dc7f3d9ca0f4b0aef2d6eccfa3df3ed08d0ea75a69c436ef40aa7a

See more details on using hashes here.

File details

Details for the file streamlit_mnist_canvas-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_mnist_canvas-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e113a4aa7227dd5454b6a49af8c5886a1a769e79eb7640a857ce108c3f363a9e
MD5 a2e153123c4e78072a774687b6fa8842
BLAKE2b-256 4e9d4f833e5a835f72a09e833355fae81d60f7f50ccd6b71cb680cc39fbed89f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page