#2323rd of 33 in Data and scraping for AIFor data and documents, documents and ocr

doctr

Two-stage OCR library for PDFs and images, built on PyTorch

Stars
6.4k
License
Apache-2.0
Last commit
Oct 2026
Last release
Aug 2026
Language
Python
Stars, last 30 weeks+459
4 Apr 2026: 5,946 stars11 Apr 2026: 5,957 stars18 Apr 2026: 5,973 stars25 Apr 2026: 5,993 stars2 May 2026: 6,006 stars9 May 2026: 6,019 stars16 May 2026: 6,035 stars23 May 2026: 6,052 stars30 May 2026: 6,068 stars6 Jun 2026: 6,078 stars13 Jun 2026: 6,096 stars20 Jun 2026: 6,106 stars27 Jun 2026: 6,121 stars4 Jul 2026: 6,132 stars11 Jul 2026: 6,143 stars18 Jul 2026: 6,149 stars25 Jul 2026: 6,158 stars1 Aug 2026: 6,168 stars8 Aug 2026: 6,174 stars15 Aug 2026: 6,261 stars22 Aug 2026: 6,281 stars29 Aug 2026: 6,303 stars5 Sept 2026: 6,318 stars12 Sept 2026: 6,330 stars19 Sept 2026: 6,343 stars26 Sept 2026: 6,352 stars3 Oct 2026: 6,358 stars10 Oct 2026: 6,376 stars17 Oct 2026: 6,387 stars24 Oct 2026: 6,392 stars31 Oct 2026: 6,405 stars

5,946 on 4 Apr 20266,405 on 31 Oct 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

docTR is a Python library that extracts text from PDFs and images by running a text detection model, then a text recognition model on each detected word. It returns a structured Document (pages, blocks, lines, words) that can be exported as JSON, and also offers a KIE predictor, optional layout detection and a FastAPI template. Detection and recognition architectures are selectable, with pretrained weights.

Who it is for: Developers adding self-hosted OCR to document pipelines in Python

Strengths

  • Swappable detection (DBNet, LinkNet, FAST) and recognition (CRNN, SAR, MASTER, ViTSTR, PARSeq, VIPTR) models
  • Handles rotated pages and returns nested page/block/line/word output exportable to JSON
  • Includes KIE predictor, layout detection and a FastAPI template with OCR and KIE routes
  • Hosted Hugging Face Space and Streamlit demo for trying it before installing

Weaknesses

  • Python 3.11 or higher required; PyTorch is the only supported framework
  • API template is minimal; README example uses port 8080 while the server runs on 8002
  • Docker GPU images need host CUDA 12.2 or newer
  • Default pipeline is OCR only; table structure and layout models are listed but sparsely documented in README

What it needs

  • GPU optional
  • Docker
  • Needs PyTorch, Streamlit (demo), FastAPI (API template), weasyprint (URL input)
  • Models: DBNet, LinkNet, FAST, CRNN, SAR
  • port 8002

Quick answers

Is doctr open source?

Yes. Its code is on GitHub under the Apache-2.0 license.

Can you run doctr with Docker?

Yes. Its repository has a Docker setup: a Dockerfile, a Compose file or a published image.

Does doctr need a GPU?

No. It runs on a CPU and can use a GPU when you have one.

Also in Data and scraping for AI

See all 33
Also in Data and scraping for AI
RankProjectScore
1mineruDocument parser that converts PDFs, images and Office files to Markdown and JSON Live demo ↗ (opens in a new tab)82.9k starscustom license94 out of 100
2doclingPython library and CLI that converts PDFs, Office files and more into structured text69.9k starsMIT91 out of 100
3opendataloader-pdfPDF parser that outputs Markdown, JSON with bounding boxes, and Tagged PDF30.1k starsApache-2.087 out of 100
#4markitdownPython library and CLI that converts office files, PDFs and audio to Markdown193.3k starsMIT86 out of 100
#5agent-reachCLI that gives coding agents read access to login-gated and Chinese web platforms107.4k starsMIT85 out of 100