docTR is a free deep learning OCR library for locating and recognizing text in documents, aimed at document automation and research. Its pretrained OCR predictors use two stages: text detection followed by recognition. A separate layout predictor can identify regions such as tables, figures, and headers. The quickstart covers loading PDFs, images, and web pages, then exporting results as plain text or a JSON-serializable dictionary. The project describes its predictors as optimized for inference on both CPU and GPU. If pretrained models are not suitable, users can train custom detection, recognition, layout, and table-structure models. The documentation describes loading and sharing models through the Hugging Face Hub, and provides a minimal REST API deployment template and browser demo. Installation is available through pip or Git, with official Docker images published through GitHub Container Registry. The installation guide requires Python 3.11 or higher. For AWS Lambda, the guide advises disabling multiprocessing and placing the model cache under /tmp to meet the environment's write restrictions. The project uses the Apache License 2.0.
Who it is for
docTR suits developers and researchers building document automation or OCR workflows who want a free library they can customize. Its REST API template and browser demo may also help teams explore deployment options.
What is good
- Pretrained two-stage text detection and recognition
- Layout prediction identifies tables, figures, and headers
- Supports CPU and GPU inference
- Custom training for detection, recognition, layout, and tables
- Apache License 2.0
What to know first
- Installation requires Python 3.11 or higher
- AWS Lambda requires multiprocessing to be disabled
- Lambda model cache must be placed in /tmp
Verdict
docTR offers OCR, layout analysis, and custom model training in a free library, with installation and deployment options including Docker and a REST API template. Check the Python requirement and AWS Lambda guidance against your environment.
docTR plans and pricing
All plansCompared on OCR software
- Free plan
- Yes

