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

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for cat_handwriting_recognizer-1.2.6.tar.gz
Algorithm Hash digest
SHA256 1cd19f775e5c70a5450871fe8a05a9341be144a14ab7511ece7f56ea82dee618
MD5 e8ac51ffdd380002ff288159d122e661
BLAKE2b-256 dce2bc1fdd09b5b34b9345066c1b358f212631ba82beb1f27a16e6393d89e662

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cat_handwriting_recognizer-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 308a36887ebb51c334a526499b645ffc18a4dc1b881353ae8020386ec978dbeb
MD5 6d3cfa7f07ecc249fed5237561ead92d
BLAKE2b-256 70403bf6e7ac3ca17096c7f6e52b780384938b28841f45a169a5a3c1042f677b

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