Skip to main content

A lightweight handwritten character recognition module using template-based KNN.

Project description

Cat Handwriting Recognizer

A simple Python module for recognizing handwritten using machine learning. Designed for easy integration and efficient preprocessing.

Features

  • Preprocess handwritten images
  • Extract simple features for recognition
  • K-Nearest Neighbors (KNN) prediction
  • Async support for building templates
  • Timeout mechanism for long-running operations
  • Save and load models as .npz files

Installation

Install from PyPI:

pip install cat-handwriting-recognizer

Install from GitHub:

pip install git+https://github.com/littlecommandcat/cat_handwriting_recognizer.git

Quick Example

from cat_handwriting_recognizer import HandwritingRecognizer  
import asyncio

recognizer = HandwritingRecognizer(timeout=-1)

# Build templates from data
asyncio.run(recognizer.build_all_templates("directory")) # Your data directory

# Save model
recognizer.save_model("model.npz") # Save model file(.npz)

# Load model
recognizer.load_model("model.npz") # Load model file(.npz)

# Predict a picture
result = asyncio.run(recognizer.predict("file.png")) # Use model to predict png/jpg/jpeg file
print(result)

Requirements

  • Python 3.10+
  • NumPy
  • Pillow

License

MIT License

Author

littlecommandcat

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

cat_handwriting_recognizer-1.2.5.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

cat_handwriting_recognizer-1.2.5-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file cat_handwriting_recognizer-1.2.5.tar.gz.

File metadata

File hashes

Hashes for cat_handwriting_recognizer-1.2.5.tar.gz
Algorithm Hash digest
SHA256 fb7d877c9d117634fe0453e8316e924ec38e8f89c472d11da23dec62aa24aae6
MD5 37b70bfabad2323408c154498ac4b0d6
BLAKE2b-256 59ca9a060ce08914fdcc83c93a26b4e2778f6634043329b66a02b1d3ac330e2f

See more details on using hashes here.

File details

Details for the file cat_handwriting_recognizer-1.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for cat_handwriting_recognizer-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4a3e72e6db4d7aa777a9121cbfcdcb21ce63c2c55bf64c85c1823e3fc38da2ae
MD5 0523403f1904c897f701521b9770693e
BLAKE2b-256 fd4b2761de290b75b297d99e60341a3e3cd41d253254f325cb6a1527475735f7

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