ocr-with-distributed-workers
Made by JeffOCR a large PDF corpus into per-document Markdown with cropped figure and score images, using focr for text and layout boxes, on one machine or fanned out across an SSH fleet with resumable per-page work, speed-weighted rebalancing and a validation gate. Use when OCRing many PDFs or scanned books, keeping figures or musical examples as images, or spreading OCR across several machines.
From Jeffrey's Skills.md: professionally crafted skills for any AI agent, installed and kept in sync by the jsm CLI. Subscription only, $20/month.
Works With
Quality and Utility come from canonical skill metadata. Community ratings appear separately as stars when subscriber reviews exist.
Subscribe to download
Public previews are available, but downloads, CLI sync, and premium content require an active subscription.
Sign In to Subscribe- Full skill content with deterministic versioning
- CLI sync + local search index
- Access to Jeffrey’s premium library
Save to your account
Saved skills live in your cloud list. Run jsm sync on each machine to pull them locally.
What's New with this Skill
1Updates, enhancements, and release notes for this skill.
New skill: ocr-with-distributed-workers, turning a folder of PDFs into Markdown with cropped figures, on one machine or a fleet
An agent OCRs a large PDF corpus into one Markdown file per document, with figures and musical examples cropped as images. Each page is rendered at 300 DPI and read by focr, whose layout boxes drive the crops. The same scripts run on one machine or across SSH workers, with resumable per-page work, rebalancing by measured pages per minute and a validation gate. They come from a 2,382-page, 28-book run across about 11 hosts, with fixes from a later review.
- Each page: a 300 DPI render with pdftoppm, focr for markdown and layout boxes, union-find clustering of image and caption boxes, crops from the same render, then assembly per document.
- focr returns boxes in the pixel space of the image it read, so crops cut from that render need no scaling. The clustering thresholds are tuned for 300 DPI.
- Scores and figures are kept as cropped images, since focr's default model marks notation as image regions instead of transcribing it.
- Text routing: cleaned pdftotext for digital documents, and focr for scanned ones and for exports whose broken ligature maps turn "different" into "di erent".
- On one machine, a single MODE=all run writes a Markdown file and an .assets folder next to each PDF, and a rerun picks up where it stopped.
- Fleet: a tab-separated workers.tsv, a per-host plan, a detached rollout to SSH workers, and a harvester that gathers, assembles and validates when they finish.
- Rebalance by measured pages per minute, entered in workers.tsv after a warm-up, because focr's speed differs 10 to 20 times between host classes, then mop up stragglers on the fast hosts.
- validate.py exits 1 on a missing page, an unreadable PDF or a broken image reference and lists unreferenced crops.
- 21 failure cards, most from the reference run and the rest from a later review, including the Linux pgrep self-match that makes a dead host look alive.
Each page goes through five steps. pdftoppm -r 300 renders it; focr ocr page.png --json returns markdown and labeled layout boxes; the image and image_caption boxes are clustered with union-find; each cluster is cropped from the same render into pNNNN_figM.png; and the page text and its crops are assembled into Markdown. focr returns its boxes in the pixel space of the image it read, so crops cut from the same render need no scaling, and the clustering margin and speck filter are tuned for 300 DPI. focr's default model does not transcribe musical notation. It marks scores as image