paddleocr
PaddleOCR
From a PDF or page images to text an agent can read whole and trust: <stem>.md, the document page by page in reading order, generated from <stem>.json, its record of what the models gave and of every change made since, with who made it and why. The model reads pixels, so scans, screenshots and tables embedded as images come out as text too; figures stay images.
Calling. Start every shell call with this statement, filled in with this file's absolute directory: set -o pipefail; export PATH="<this directory>/scripts:<this directory>/../vllm-serve/scripts:$PATH"; — ocr.py and vllm-serve's serve.py are then found from any directory, and a failure anywhere in a pipe sets the call's exit code. ocr.py -h lists the words; ocr.py <word> -h is each one's reference: options, lines, exit codes (parse -h the folder layout, findings -h the finding codes). stdout is data (show's is text to read); stderr holds progress and warnings, so keep it: on exit 2 its last line {code, hint} says why nothing could go on. ocr.py parse needs the paddleocr uv tool on an NVIDIA GPU; paddleocr_missing, a vl_server_* code, a crash at start-up, a hang of the native backend, or no pdftotext / pdftoppm → references/install.md.
A paper (a journal or conference article, a preprint, a thesis chapter) → also references/papers.md: how papers number figures, tables and equations, and what goes wrong in them.
Steps
1. Parse
ocr.py parse <document.pdf> [more inputs ...] -o <outdir>/
Give all the documents in one call: the models load once per call. The first run downloads about 2 GB of models into ~/.paddlex/official_models/. Run anything beyond a few pages in the background and wait for it to exit.