Skip to content

jbarrow/omniocr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omniocr

Python packge for using OmniOcr: https://omniocr.ai

pip install omniocr

Usage

Get your API key from: https://omniocr.ai/

Then you can start to OCR documents with:

export OMNIOCR_API_KEY=<OMNIOCR_API_KEY>

omniocr examples/resources/sample.pdf \
    --model=lightonocr-2-1b \
    --format=markdown \
    --pages "1-3" > output.md

Alternatively, you can run it programmatically:

from omniocr import OmniOcr


client = OmniOcr()

document = client.process(
    "examples/resources/sample.pdf",
    model="lightonocr-2-1b",
    format="markdown",
    pages="1-3"
)

print(document)

Formats

There are two types of formats that omniocr supports:

  1. markdown conversion -- this is the simplest, the document is just converted to markdown, typically with placeholders for images
  2. block-based output -- if you need bounding boxes for where the text comes from, you should use a model that supports bounding box outputs

Supported Models

About

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages