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.1.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.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: streamlit_mnist_canvas-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 be8dc4ec32b7bfdcb9189bcaf0079e23cfdc52e82aa49d440eb85c341797935a
MD5 e5871f636411121067f77948fd918789
BLAKE2b-256 fdfdda58e2d27dc60107e37289ac023fdba0d44a4afe93c7412744ef6640e151

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for streamlit_mnist_canvas-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bbdb3ede6919fc0c8e4d07e05ed6b0fc9e25d2f535ca1639c55a42221f57aa14
MD5 8187b340c538b2f984aff5864d2541a8
BLAKE2b-256 174bb262d1ead485f67940b999c7137bbdae26672e71920dba038e7a5d1c8722

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