Pick your own eyes and brain for document OCR
A Python toolkit that treats text detection and recognition as separate, swappable concerns.

What it does
docTR is a deep-learning OCR library that pulls text out of PDFs, images, and even web pages. It runs a two-stage pipeline: a detection model locates words, then a recognition model reads them. The output is a structured document tree—pages, blocks, lines, words—that you can visualize or export as JSON.
The interesting bit
Instead of a monolithic black box, docTR lets you mix and match detection architectures (DBNet, FAST, LinkNet) with recognition architectures (CRNN, PARSeq, ViTSTR). It also offers a KIE predictor that detects semantic classes like dates or addresses rather than just dumping raw text, plus a synthesis mode that rebuilds the original page from predictions to sanity-check results.
Key highlights
- Modular pipeline: pair detection and recognition models independently.
- Handles rotated text with options for straight or angled bounding boxes.
- Structured output hierarchy (
Page,Block,Line,Word) exportable to nested dictionaries. - KIE predictor for class-specific extraction beyond plain OCR.
- Ships with pretrained weights, GPU-ready Docker images, and a live Hugging Face demo.
Caveats
- Web page ingestion requires an extra dependency (
weasyprint). - Docker GPU images need a host CUDA version of at least 12.2.
Verdict
Reach for docTR if you want fine-grained control over OCR architecture choices or structured document parsing. Skip it if you just need a quick, opaque API call and do not care which model is doing the reading.
Frequently asked
- What is mindee/doctr?
- A Python toolkit that treats text detection and recognition as separate, swappable concerns.
- Is doctr open source?
- Yes — mindee/doctr is open source, released under the Apache-2.0 license.
- What language is doctr written in?
- mindee/doctr is primarily written in Python.
- How popular is doctr?
- mindee/doctr has 6.2k stars on GitHub.
- Where can I find doctr?
- mindee/doctr is on GitHub at https://github.com/mindee/doctr.