EasyOCR, tested on a Mac
1,658 of 1,955
words found, 10 scanned pages
Run EasyOCR on a scanned PDF
58 to 61 s for 10 pages, Mac GPU
98 MB of models, first run
On a Mac, in a folder with scan.pdf:
python3 -m venv eo && source eo/bin/activate
pip install easyocr pypdfium2
python ocr.py scan.pdf > scan.txt
ocr.py:
import sys
import easyocr
import numpy as np
import pypdfium2 as pdfium
reader = easyocr.Reader(["en"], verbose=False)
for page in pdfium.PdfDocument(sys.argv[1]):
img = np.array(page.render(scale=300 / 72).to_pil().convert("L"))
print("\n".join(reader.readtext(img, detail=0, paragraph=True)))
EasyOCR reads images, not PDFs, so pypdfium2 draws each page at 300 dpi. Once the models are downloaded, a run with no network gave the same text.
gpu=True already means the Mac GPU
Reader(["en"]) has gpu=True by default. With
no CUDA, EasyOCR 1.7.2 picks MPS, the Apple GPU.
| Mode | Mac GPU | CPU, 2 threads |
|---|---|---|
| readtext defaults | 42.8 s | 338.6 s |
| paragraph=True | 39.4 s | 368.5 s |
quantize=False on 2 CPU threads: same text, 353.3 s.
Other jobs shared the Mac, so times are rough.
Every run, CPU too, prints a torch pin_memory warning. GPU and CPU text matched, byte for byte.
paragraph=True: most words
On the 10 JPEG files, Mac GPU. Every row after the first also has
paragraph=True.
| Option | Words found | Time |
|---|---|---|
| defaults (short text boxes) | 1,606 | 42.8 s |
| paragraph=True | 1,670 | 39.4 s |
| + mag_ratio=1.5 | 1,670 (same text) | 58.3 s |
| + batch_size=8 | 1,670 | 42.1 s |
| + text_threshold=0.5, low_text=0.3 | 1,650 | 53.4 s |
| + decoder="beamsearch" | 1,550 | 56.9 s |
The page script also passes detail=0, which returns only
the strings. From the PDF it found 1,658: the two image paths differ a
little.
Models land in ~/.EasyOCR/model
The first Reader(["en"]) downloads them from the
JaidedAI/EasyOCR
GitHub releases. That run took 64.1 s. Later runs downloaded
nothing.
| File | Size | Job |
|---|---|---|
| craft_mlt_25k.pth | 83.2 MB | finds text |
| english_g2.pth | 15.1 MB | reads English |
model_storage_directory picks another folder. With
download_enabled=False and no models:
FileNotFoundError: Missing ~/.EasyOCR//model/craft_mlt_25k.pth and downloads disabled
The real message shows your full home folder in place of ~.
The progress bar lands in your text file
With verbose left on, the first
Reader(["en"]) printed 11,147 progress-bar updates into
stdout, and the first line of text came right after the last one. So
> scan.txt caught them all.
verbose=False, as in the script, gave 0.
Two errors you will hit
A PDF path in place of an image:
OSError: Could not find a backend to open `scan.pdf`` with iomode `r`.
Draw the pages with pypdfium2, as in the script.
Reader(["ch_sim", "ja"]) stops before it downloads a
Chinese or Japanese model:
ValueError: Chinese_sim is only compatible with English, try lang_list=["ch_sim","en"]
Keep the CRAFT detector, not dbnet18
detect_network="dbnet18" fails on the GPU:
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.
On the CPU, it fails when ninja is not on PATH, for example when you run eo/bin/python without activating the venv:
RuntimeError: Input type is cpu, but 'deform_conv_cpu.*.so' is not imported successfully.
With the venv active, it builds C++ code and downloads 46.8 MB more. Then it finds fewer words, more slowly:
| Detector | Words found | Time |
|---|---|---|
| CRAFT (default) | 1,670 | 368.5 s |
| dbnet18 | 1,468 | 788.0 s |
EasyOCR often reads s as g
| Reader | Words found |
|---|---|
| Gemma 4 e4b | 1,947 |
| RapidOCR | 1,894 |
| The pdf-ocr Actor's code | 1,879 |
| Tesseract 5.5.4 | 1,878 |
| EasyOCR, paragraph=True | 1,670 |
In the page script's text (1,658 words found), 113 words came out as another word.
Of those, 27 are an s read as g or 8, as in glackened,
gtory and a8. Most others are punctuation:
- A period as a colon:
tommyrot: - Quote marks as
((or66
How I tested it
- Pages: the 10 scans of OCR in n8n, proofread Wikisource book pages, 1,955 true words, as 1920 px JPEGs and one PDF.
- easyocr 1.7.2 and torch 2.15.0 on Python 3.14.7, on an Apple Silicon Mac. Installing easyocr and pypdfium2 made a venv of 1,111 MB.
- One run at a time, lowest priority, torch on 2 CPU threads. The first run started from an empty model folder.
- Score: true words found in order. The Gemma 4, Tesseract and Actor rows come from my Gemma 4 test of the same files, RapidOCR from my RapidOCR test.
-
batch_size=8changed the text a little: 17 paragraphs, not 20.
What I did not test
- CUDA and NVIDIA GPUs, Windows and Linux.
- Other languages, and text boxes (the default detail=1).
Text from a PDF, no model download
Run it yourself. Our Apify Actor takes a PDF and returns text, with no model download on your Mac. Its code found 1,879 of these 1,955 words.
Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. First page free.
Questions people ask
Does EasyOCR use the GPU on a Mac?
Yes, by default: gpu=True picks MPS, the Apple GPU. With paragraph=True it took 39.4 s on the GPU and 368.5 s on 2 CPU threads, with the same text.
Where does EasyOCR store its models?
In ~/.EasyOCR/model. For English that is craft_mlt_25k.pth (83.2 MB), which finds the text, and english_g2.pth (15.1 MB), which reads it.
Is EasyOCR better than Tesseract?
Not on these scanned book pages. EasyOCR found 1,670 of 1,955 words on the JPEG files (1,658 with the page script), and Tesseract 5.5.4 found 1,878.
Related guides
- OpenCV OCR in Python: text detection and recognition, tested
- EasyOCR vs Tesseract vs PaddleOCR vs RapidOCR, tested
- RapidOCR in Python: tested vs Tesseract and PaddleOCR
- Gemma 4 OCR: 5 sizes tested on a scanned book in Ollama
- PaddleOCR on a Mac: CPU setup and results, tested
- Apple Vision OCR vs Tesseract, tested on 523 scans
- Tesseract GPU support: none. What speeds it up, tested