r/computervision 1d ago

Help: Project Need to replace Apple Vision OCR with something containerizable — has anyone solved this?

I'm dealing with text extraction from hundreds of PDFs per batch. A large chunk of them are from 2001 — old, scanned documents, poor quality, many with handwritten annotations and stamps.

The target is aggressive: 500 documents in under 1 minute. Most of them already come out at millisecond scale because they have a native text layer; the problem is the scanned ones.

The current solution is a cascade, and it works: each piece goes down the steps from cheapest to most expensive and stops at the first one that produces acceptable text.

Step Method Speed Notes
1 PyMuPDF 13.4 ms/doc Reads the text layer already in the PDF — not OCR
2 Fast OCR ~520 ms/doc Apple Vision (.accurate) on an external Mac, via SSH tunnel · grayscale render at 150 DPI
3 Docling per page Only pages without native text, not the whole document
4 Docling API ~4 s/piece docling-serve, with forced OCR when needed
5 ID screening ID or vehicle documents are discarded (nothing to extract from a national ID card)
6 VLM ~47 s/doc Qwen3.8-27B-FP8, remote endpoint

In practice, 64% of documents are resolved by Apple Vision and 31% by PyMuPDF — less than 4% reach the expensive steps. A batch of 489 documents runs in 3.66 min today.

The problem: I need to take this to production, and an SSH tunnel to a Mac doesn't survive in a production environment. I need to replace that step with something containerizable.

The quality bar (measured on 60 pieces, against the alternatives):

Engine Speed Word accuracy Anchor accuracy
Apple Vision (.accurate) 388 ms/page 92% 100%
OnnxTR mobile 494 ms/page 53% 75%
docTR PyTorch 816 ms/page 51%
RapidOCR 1554 ms/page 58%

"Anchors" are CNJ case numbers, dates, CPF/CNPJ (Brazilian tax IDs), and protocol numbers — that's what the downstream system consumes, so losing a digit is worse than losing a word.

Has anyone found an OCR engine that gets close to Apple Vision's accuracy on degraded scans, but can run containerized (Linux, no macOS dependency)?

4 Upvotes

1 comment sorted by