Pre-Trained OCR Model: What to Download, How to Run It, and When It Falls Short
A pre-trained OCR model is a text detection or recognition network that someone else has already trained on a large labeled dataset, so you can download the weights and read text with it on day one. Tesseract, PaddleOCR, docTR, EasyOCR, and TrOCR all ship this way. For printed documents in a supported language, one of them is often good enough without any training of your own. Where they fall short is predictable: handwriting the model never saw, unusual fonts, low-resolution photos, and domain strings such as part numbers or codes that do not look like ordinary words.
The practical question is not which pre-trained model is best in general. It is which one reads your pages well enough, and how you would know. This guide covers what the common checkpoints were built for, how to load each in a few lines of Python, and a small script that scores a model against your own ground truth so you can decide between using it as is, fine-tuning it, or calling a hosted API.
What “pre-trained” means for OCR
Most OCR models are trained in stages. A detection network learns where text sits on a page, a recognition network learns to turn a cropped line or word into characters, and both learn from hundreds of thousands to millions of labeled examples, often a mix of real scans and synthetic text rendered in many fonts. A pre-trained model is the result of that work, packaged as a weights file plus the code that runs it.
Two consequences follow. First, a model only knows the character set and visual styles that were in its training data. A recognizer trained on Latin print will not read Devanagari, and one trained on clean print may stumble on dot-matrix receipts. Second, pre-trained weights are the usual starting point for customization. If you later decide to train a custom OCR model, you will almost always fine-tune one of these rather than start from random weights.
If you want the detection, recognition, and layout stages explained step by step, the OCR engine guide walks through them. Here the focus is on what you can download and use.
Pre-trained OCR models you can run today
| Model family | What ships pre-trained | Best fit | Output |
|---|---|---|---|
| Tesseract | LSTM traineddata files per language and script | Clean printed pages, CPU only, many languages | Text, hOCR, TSV with word boxes and confidences |
| PaddleOCR (PP-OCR series) | Detection, recognition, and orientation models in several sizes | Mixed print, multilingual pages, scene text | Lines with boxes and scores, JSON |
| docTR | Choice of detection and recognition architectures | Python pipelines that need structured page, block, line, word output | Nested document object, JSON export |
| EasyOCR | Detection plus recognition for 80+ languages | Quick multilingual prototypes | Box, text, confidence per detection |
| TrOCR | Transformer encoder-decoder for single text lines | Handwritten or printed lines after you crop them | A string per line image |
Tesseract traineddata
Tesseract’s LSTM models come in two official sets. According to the Tesseract data files documentation, tessdata_fast uses integer models that trade a little accuracy for speed, while tessdata_best uses float models that score best on Google’s evaluation data and are the only ones that can serve as a base for fine-tuning. Both work only with the LSTM engine (--oem 1). You select a model by language code, for example eng, deu, or eng+fra for mixed pages.
PaddleOCR PP-OCR
PaddleOCR packages its detection and recognition models as the PP-OCR series. The PaddleOCR OCR pipeline documentation states that recent releases use PP-OCRv6 by default, with tiny, small, and medium tiers, and that you can switch back to PP-OCRv5 or PP-OCRv4 with the ocr_version parameter. The project’s own figures put v6 ahead of v5. Treat those as the vendor’s numbers until your own test agrees.
docTR
docTR lets you pick a detection architecture such as db_resnet50 and a recognition architecture such as crnn_vgg16_bn, and loads pre-trained weights with pretrained=True. Its output is a structured page, block, line, and word tree that exports to JSON, which is convenient when you need coordinates downstream.
EasyOCR
EasyOCR advertises ready-to-use recognition for 80+ languages across Latin, Chinese, Arabic, Devanagari, Cyrillic, and other scripts. You create a reader with a list of language codes and it downloads the matching weights on first use.
TrOCR
TrOCR is an encoder-decoder transformer: an image encoder initialized from BEiT and a text decoder initialized from RoBERTa. The model card is explicit that it reads single text-line images, so you need a separate detector or your own cropping to use it on full pages. The trocr-base-handwritten checkpoint is fine-tuned on the IAM handwriting dataset, and printed variants exist on the same hub.
General vision-language models and document VLMs are also pre-trained and can read whole pages into Markdown. They are a different trade-off in size, cost, and failure mode, and the OCR model guide compares them with classic engines.
Load a pre-trained OCR model in a few lines
Each library hides the download behind one constructor. These snippets follow the projects’ own documentation.
# Tesseract: needs the tesseract binary plus the traineddata for your language
import pytesseract
from PIL import Image
text = pytesseract.image_to_string(Image.open("page.png"), lang="eng", config="--oem 1 --psm 3")
# PaddleOCR 3.x: downloads the default PP-OCR models on first run
from paddleocr import PaddleOCR
ocr = PaddleOCR(lang="en", use_doc_orientation_classify=False, use_doc_unwarping=False)
for res in ocr.predict("page.png"):
print("\n".join(res["rec_texts"]))
# docTR: choose detection and recognition architectures
from doctr.io import DocumentFile
from doctr.models import ocr_predictor
model = ocr_predictor(det_arch="db_resnet50", reco_arch="crnn_vgg16_bn", pretrained=True)
result = model(DocumentFile.from_images("page.png"))
print(result.render())
# EasyOCR: one reader per language set, reuse it across images
import easyocr
reader = easyocr.Reader(["en"])
for box, text, confidence in reader.readtext("page.png"):
print(round(confidence, 2), text)
First runs download weights, so allow for that in containers and air-gapped machines. Pin the library version and, where the project allows it, the model name, so an upgrade does not silently change your output.
Measure a pre-trained model on your own pages
Published accuracy comes from public datasets. Your invoices, delivery notes, or handwritten forms are not in them. Before choosing, collect 20 to 50 representative pages, type the correct text for a few lines on each into a .txt file next to the image, and measure character error rate (CER): the number of character edits needed to turn the model’s output into the truth, divided by the length of the truth.
# score_ocr.py: compare a pre-trained model's output with hand-typed ground truth
from pathlib import Path
import pytesseract
from PIL import Image
def edit_distance(a: str, b: str) -> int:
prev = list(range(len(b) + 1))
for i, ca in enumerate(a, 1):
cur = [i]
for j, cb in enumerate(b, 1):
cur.append(min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (ca != cb)))
prev = cur
return prev[-1]
def normalize(s: str) -> str:
return " ".join(s.split())
def read_page(path: Path) -> str:
# swap this function to test PaddleOCR, docTR, or EasyOCR on the same pages
return pytesseract.image_to_string(Image.open(path), lang="eng", config="--oem 1")
total_edits = total_chars = 0
for image in sorted(Path("samples").glob("*.png")):
truth = normalize(image.with_suffix(".txt").read_text(encoding="utf-8"))
predicted = normalize(read_page(image))
edits = edit_distance(predicted, truth)
total_edits += edits
total_chars += len(truth)
print(f"{image.name}: CER {edits / max(len(truth), 1):.1%}")
print(f"overall CER {total_edits / max(total_chars, 1):.1%}")
Two details matter. If your ground truth covers only part of a page, crop the image to that region first, or the extra text the model reads will count as errors. And look at the per-page numbers, not just the total. A model that is excellent on 45 pages and useless on five usually points to one document type, such as faxes or handwritten notes, that needs a different path.
Run the same script with each candidate by replacing read_page. The model with the lowest CER on your samples is the one to start with, regardless of its leaderboard position.
When a pre-trained OCR model is not enough
The score tells you what to do next:
- Low error on most pages. Use the model as is. Add validation for the fields that matter, such as totals, dates, and IDs, because even a good model will occasionally swap a character.
- Errors concentrated on image quality. Fix the input before the model. Higher scan resolution, deskewing, and avoiding heavy JPEG compression often help more than a different model. The checklist in why OCR output goes wrong covers the common causes.
- Errors concentrated on one script, font, or handwriting style. This is where fine-tuning a pre-trained base pays off, provided you can label a few thousand line images and maintain the result.
- You need fields, not text. A recognizer returns characters. Turning them into an invoice number or a due date is a separate step, either rules you write or a model that understands the page.
Where OCRskill fits
Running a pre-trained model yourself means you own the download, the hardware, version pinning, and the glue between detection, recognition, and your data format. OCRskill is the hosted alternative: you send an image or PDF and get Markdown back from POST /ocr, or typed JSON for the fields you name from POST /ocr.json.
curl -s https://api.ocrskill.com/ocr \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: image/png" \
--data-binary "@page.png"
You can put it through the same CER script by making read_page call the API. It does not return per-word boxes or confidences the way Tesseract or docTR do, so if your application needs word coordinates, a local model is still the better fit for that part. The structured JSON API reference lists the fields it can return.
Limitations of this guide
- Model versions move quickly. Default models in PaddleOCR and other libraries change between releases. Check the current documentation before you pin a version.
- CER is not the whole story. A model can have low CER and still drop a critical digit. For business documents, also measure field-level accuracy on the values you act on.
- Licenses differ. Library code and model weights can carry different terms. Read both before you ship a model inside a commercial product.
Conclusion
A pre-trained OCR model removes the hardest part of OCR, collecting and labeling a training set, but it carries the assumptions of whoever trained it. That is why the decision should rest on a small, honest test rather than a benchmark table. Type the truth for a few dozen of your own pages, score two or three candidates with the same script, and look at where the errors cluster. Low, scattered errors mean ship it with validation. Errors tied to image quality mean fix capture. Errors tied to one script or hand mean fine-tuning a pre-trained base is finally worth the effort. Keep the sample set afterward: it becomes your regression test for every model or library upgrade.
