Skip to main content

Universal MonOCR package with ONNX bindings

Project description

MonOCR (Python SDK)

The official Python SDK for Mon language OCR, powered by ONNX Runtime. Optimized for high-throughput batch processing and production server environments.

Installation

pip install monocr-onnx

Features

  • Parallel Processing: Native support for multithreaded batch OCR.
  • Auto-Model Discovery: Automated caching of model weights from MonDevHub/monocr.
  • Comprehensive API: Unified methods for images, PDFs, and accuracy benchmarking.
  • Production CLI: Feature-rich command-line interface for rapid deployment.

Quick Start

from monocr_onnx import read_image, read_images

# Recognize single image
text = read_image("document.png")

# Parallel batch recognition
results = read_images(["img1.jpg", "img2.jpg"], workers=8)

API Reference

read_image(image_path, [options]) -> str

Recognize text from a single image file.

read_images(image_paths, [workers=4]) -> list[str]

Recognize text from a list of images in parallel.

read_pdf(pdf_path) -> list[str]

Extract text from all pages of a PDF document.

read_image_with_accuracy(image_path, ground_truth) -> dict

Performance benchmarking with Levenshtein-based accuracy metrics.

CLI Usage

# Recognize an image
monocr image input.jpg

# High-performance PDF conversion
monocr pdf document.pdf

# Batch directory processing
monocr batch ./input -o results.json

Maintenance

Maintained by MonDevHub.

License

MIT

  • Python 3.9+
  • poppler-utils (for PDF support via pdf2image)

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

monocr_onnx-0.1.0.tar.gz (65.4 kB view details)

Uploaded Source

Built Distribution

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

monocr_onnx-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: monocr_onnx-0.1.0.tar.gz
  • Upload date:
  • Size: 65.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for monocr_onnx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 446b7beed06369a30720305e3378b5745fc6fc5c035b0ff2ba39270fb24126d9
MD5 f8a79a04fbc98882191ce6f9569095c7
BLAKE2b-256 182705e613234e376623a9413e339ef2187811ca120802f54d0ec67e01980843

See more details on using hashes here.

File details

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

File metadata

  • Download URL: monocr_onnx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for monocr_onnx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fab61230b5c9c19f9b967b9424a499cf25fb0b26378ac872a54f3aeb52f37dc
MD5 0e73eb7f1ebb62565399c0bc847cfeb0
BLAKE2b-256 0404f0186d170b0e33b13aaca757f19f1e9ea273a0189de6a90509abefb7fc2c

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