glyphwise ocr

Speed

Thousands of pages an hour, on a laptop.

Every figure on this page was measured on one ordinary laptop (Intel Core i9-10885H, 8 cores / 16 threads, an entry-level NVIDIA GTX 1650 Ti, 64 GB) with the 1.5 download, on the same 38 full pages the accuracy tests use: Federal Register pages, IRS forms and a NIST report at 300 dpi, about 730 words each. Tesseract ran on the same files on the same machine. Where it is faster, we say so.

Pages per hour

The 38 test pages read as one batch. Longer is better.

  • Fast, GPU6,400
  • Fast, CPU5,800
  • Accurate, GPU2,000
  • Accurate, CPU2,050

PDFs that already contain text skip recognition: about 340 pages a second.

Batches

Reading a folder of pages.

Given many pages (several files on the command line, a --watch folder, the desktop window), Glyphwise reads several at once and keeps every core busy. Total time for the 38 pages, median of three runs after a warm-up.

Total time for the 38 pages

Same laptop, same files. Shorter is better.

  • Tesseract 5.4, 16 at once15 s
  • Glyphwise, GPU21 s
  • Glyphwise, CPU23 s
  • Accurate, GPU68 s
  • Accurate, CPU67 s
  • Tesseract 5.4, one at a time98 s
FastestGlyphwiseTesseract, one page at a time

Tesseract is faster when 16 copies run side by side, one thread each; one page at a time, with its own threading, it takes 98 s. On these pages it also misses or misreads nearly three times as many words (word F1 94.1% vs 97.9%, see Accuracy). In a batch Glyphwise's fast model takes about 0.6 s per page; the accurate model, which also reads Chinese, about 1.8 s.

One page

How long you wait for a single page.

A page read on its own, as when you open one scan in the desktop window or send one request to the HTTP service. 16 threads, processor only; each row is 114 timings (38 pages, three times).

Time per page

A typical page (median) and a slow one (95th percentile). Shorter is better.

  • Fast
    the default
    1.52 s
    1.82 s
  • Accurate
    --accurate
    3.12 s
    4.26 s
  • Fast + handwriting
    the desktop default
    1.61 s
    2.09 s
  • Phone photos, fast
    the 38 pages photographed
    1.15 s
    1.48 s
  • Phone photos, accurate
    2.66 s
    3.87 s
Median95th percentile

The handwriting model only re-reads lines the main model is unsure of, so on printed pages it adds about 0.1 s. The photos are quicker than the scans because they are smaller images.

One page, by processor threads

Median time per page, fast model. Shorter is better.

  • 1 thread3.46 s
  • 2 threads2.30 s
  • 4 threads1.80 s
  • 8 threads1.51 s
  • 16 threads1.52 s

A single page stops getting faster beyond 8 threads, the laptop's physical cores. Batches use the rest: the 38 pages take 23 s read together, 53 s one after another.

NVIDIA cards

A graphics card helps a little.

With --gpu (or the desktop setting) the neural network runs on an NVIDIA card through CUDA; layout, cleanup and the language model stay on the processor. The text comes out the same either way. Measured on a GTX 1650 Ti, a 4 GB entry-level laptop card.

GPU and processor

Seconds per page. Shorter is better.

  • Fast, one page
    median
    1.35 s
    1.52 s
  • Accurate, one page
    median
    2.77 s
    3.12 s
  • Fast, batch
    per page, 38 at once
    0.56 s
    0.62 s
  • Accurate, batch
    per page, 38 at once
    1.79 s
    1.76 s
With the GPUProcessor only

About 10% faster for a single page with either model. In batches the processor already keeps up: on this laptop the card gains the fast model 10% and the accurate model nothing.

Where the time goes

One page, fast model, processor only: median seconds per part.

  • Recognition and layout1.31 s
  • Image cleanup0.23 s
  • Language model0.07 s

Image cleanup (turned pages, skew, photographed pages) and the language model are under a fifth of the time together. Recognition includes word boxes, forms and barcodes.

Memory and text PDFs

Modest memory, and no OCR where it is not needed.

Memory in use

Peak working set of the whole process, fast model.

  • One page at a time0.8 GB
  • 38-page batch, CPU2.4 GB
  • 38-page batch, GPU2.9 GB

An 8 GB computer is enough for batches. Chinese pages need more: 38 of them read at once by the accurate model peaked at 5.8 GB.

PDFs that already contain text

60 EU legal acts: 8,332 pages, 105 MB, one file after another.

  • Read from the text layer24 s

About 340 pages a second. Glyphwise checks each PDF page: when it holds usable text, that text is used with its positions; scanned pages, and pages whose fonts cannot be decoded, are read by OCR.

All results

Every number in one table.

TestFast, CPUFast, GPUAccurate, CPUAccurate, GPUTesseract 5.4
38 pages as one batchtotal time; Tesseract: 16 copies at once / one page at a time23.4 s21.4 s66.8 s68.0 s15.0 / 98.1 s
One page, median16 threads1.52 s1.35 s3.12 s2.77 s—
One page, 95th percentile1.82 s1.74 s4.26 s3.87 s—
Phone photos, one pagemedian / 95th percentile1.15 / 1.48 s—2.66 / 3.87 s——
One page with the handwriting modelmedian / 95th percentile1.61 / 2.09 s————
One page by threadsmedian at 1 / 2 / 4 / 8 threads3.46 / 2.30 / 1.80 / 1.51 s————
Peak memoryone page at a time / 38-page batch0.76 / 2.4 GB1.1 / 2.9 GB1.2 / 2.9 GB1.4 / 3.4 GB—
Chinese pages38 held-out pages, --lang zh: one page, median / per page in a batch——2.85 / 1.09 s——
PDF text layer8,332 pages of EU acts, one file at a time24 s————

Intel Core i9-10885H laptop (8 cores, 16 threads), NVIDIA GTX 1650 Ti 4 GB, 64 GB, Windows 11, nothing else running; Glyphwise 1.5 models with the English language model (Chinese pages: the Chinese one). Times cover cleanup, layout, recognition, the language model, word boxes, forms and barcodes, not reading the image file. Tesseract 5.4 ran with its standard English model as a separate program per page, start-up included. Your times depend on the processor and on how much text the pages hold.

Test it on your own pages.

Your documents are the only benchmark that counts.