Use the LiveText framework for stronger OCR
mainOn macOS Sonoma and later, you can use the livetext framework, which is more powerful than the standard vision backend.
Key differences when using livetext:
recognition_levelandconfidence_thresholdare not available.- The
confidenceoutput is always1. - Supports a
unitparameter: useunit='line'to return full-line items instead of token-level items.
You can access LiveText via the OCR class or a direct helper function.
from ocrmac import ocrmac
# Using the OCR class
annotations = ocrmac.OCR('test.png', framework="livetext", unit='line').recognize()
# Using the helper directly
annotations = ocrmac.livetext_from_image('test.png')