Skip to main content

ocrmac (Apple Vision) OCR engine for OCR Bridge

Project description

OCR Bridge - ocrmac Engine

ocrmac (Apple Vision Framework) OCR engine for OCR Bridge.

Overview

This package provides an ocrmac engine that integrates with the OCR Bridge architecture. ocrmac uses Apple's Vision framework for OCR, providing excellent performance and accuracy on macOS systems.

Features

  • Native macOS: Uses Apple's Vision framework (macOS 10.15+)
  • LiveText Support: macOS Sonoma 14.0+ for enhanced accuracy
  • Multiple Formats: JPEG, PNG, TIFF, PDF
  • Fast Performance: ~131-207ms per image depending on mode
  • HOCR Output: Structured XML with bounding boxes

Platform Requirements

  • macOS 10.15+ for Vision framework (fast/balanced/accurate modes)
  • macOS Sonoma 14.0+ for LiveText framework

Installation

pip install ocrbridge-ocrmac

Note: macOS only! This package will not work on Windows or Linux.

Usage

The engine is automatically discovered by OCR Bridge via entry points.

Parameters

  • languages (list[str] | None): IETF BCP 47 codes (e.g., ["en-US"], ["zh-Hans"]) (default: None = auto-detect)
  • recognition_level (RecognitionLevel): fast/balanced/accurate/livetext (default: balanced)

Example

from pathlib import Path
from ocrbridge.engines.ocrmac import OcrmacEngine, OcrmacParams, RecognitionLevel

engine = OcrmacEngine()

# Process with defaults
hocr = engine.process(Path("document.pdf"))

# Process with custom parameters
params = OcrmacParams(
    languages=["en-US", "fr-FR"],
    recognition_level=RecognitionLevel.ACCURATE
)
hocr = engine.process(Path("document.pdf"), params)

# Use LiveText (macOS Sonoma 14.0+ only)
params_livetext = OcrmacParams(
    languages=["en-US"],
    recognition_level=RecognitionLevel.LIVETEXT
)
hocr = engine.process(Path("document.pdf"), params_livetext)

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

ocrbridge_ocrmac-2.0.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

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

ocrbridge_ocrmac-2.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file ocrbridge_ocrmac-2.0.0.tar.gz.

File metadata

  • Download URL: ocrbridge_ocrmac-2.0.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ocrbridge_ocrmac-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5dc8f5f82a7c247e42a71be90465906cb8e0ad570747eebcbb196da086b8eb00
MD5 13169586c61a1ca77885d1035123c745
BLAKE2b-256 26fccbee9bb1d51c04deb10221e84adcfbbbff97445989d6a2e84d546dde0685

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocrbridge_ocrmac-2.0.0.tar.gz:

Publisher: release.yml on OCRBridge/ocrbridge-ocrmac

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ocrbridge_ocrmac-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ocrbridge_ocrmac-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1473dad8fda54ccf1fca58f91a2327dce3648f4d35af2cd437a10b601b0685c2
MD5 a7731f7c3af627afdecfcbf0b9d27139
BLAKE2b-256 1a4c502d1681375cd043bd56782380d88e154c57c058bc64a3251978b1e20175

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocrbridge_ocrmac-2.0.0-py3-none-any.whl:

Publisher: release.yml on OCRBridge/ocrbridge-ocrmac

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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