Metadata-Version: 2.1
Name: cat-handwriting-recognizer
Version: 1.2.5
Summary: A lightweight handwritten character recognition module using template-based KNN.
Home-page: https://github.com/littlecommandcat/cat_handwriting_recognizer
Author: littlecommandcat
Author-email: littlecommandcat <cyingda742@gmail.com>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Multimedia :: Graphics
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# 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:

```bash
pip install cat-handwriting-recognizer
```

Install from GitHub:

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

## Quick Example
```py
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
