glyphwise ocr

For developers

OCR inside your own software.

Every word comes back as a typed object with its text, confidence and position; errors arrive as your language's exceptions. One loaded model serves many threads, and nothing calls out to the internet.

Libraries

A few lines in the language you use.

Ready wrappers for Python, .NET, Java, Node.js and Go over a small C API, with examples for each in the download.

from glyphwise import Glyphwise

with Glyphwise("models/line.bin") as ocr:
    doc = ocr.read("scan.pdf", lang="fr")
    for w in doc.words():
        if w.confidence < 0.8:
            print("check:", w.text, w.bbox)

Underneath is a C API (include/glyphwise.h) for anything else. Tables come back as typed tables with a cell grid in every wrapper. Building it into an application is part of the Developer licence.

What comes back

Every word with its box and confidence.

The same structure in JSON, in the wrappers' typed objects, and in hOCR and ALTO for archive systems. Boxes are in pixels of the image you passed in; PDF text layers are read directly and marked as such.

Reading order

Pages, blocks, lines and words, in the order a person reads them, with headers and footers marked.

Confidence you can act on

Route low-confidence words to a person and let the rest flow through.

Structured data too

Tables with rows, columns and cell boxes; form fields, checkboxes and barcodes on every page.

{
  "engine": "line",
  "source": "fw4-photo.png",
  "units": "pixels",
  "pages": [{
    "page": 1, "width": 2550, "height": 3300,
    "method": "ocr", "skew_degrees": 0.4,
    "blocks": [{
      "index": 0,
      "lines": [{
        "text": "OMB No. 1545-0074 2026",
        "confidence": 0.87,
        "words": [{
          "text": "2026",
          "confidence": 0.61,
          "bbox": { "x": 2104, "y": 212,
                    "width": 168, "height": 58 }
        }, ...]
      }, ...]
    }, ...],
    "fields": [...], "checkboxes": [...], "barcodes": [...]
  }]
}

An example, shortened: one word of one line, with the keys the JSON output uses.

Four ways to run it

From one folder of scans to your own application.

Desktop window

Drop files or folders on the window, tick the formats and convert. Nothing to configure.

glyphwise-gui

Command line and hot folder

Batch-convert folders in parallel, or watch a folder and read every file that appears. Add --gpu to use an NVIDIA card.

glyphwise models\line.bin scans ^
  --out-dir out --formats pdf,docx,xlsx
glyphwise models\line.bin --watch inbox --out-dir out

Local HTTP service

For your document system or scanner workflow. Loopback by default; tokens or named API keys when other machines call it.

glyphwise-server --model models\line.bin
curl --data-binary @scan.pdf ^
  "localhost:8080/ocr?format=alto"

Library

Python, .NET, Java, Node.js and Go wrappers, and the C API for anything else.

doc = ocr.read("scan.pdf")
print(doc.text)

HTTP service

One endpoint, every output.

Post the raw file bytes to /ocr; choose the result with query parameters. /health lists the loaded languages and modes.

ParameterValuesWhat it does
formatjson (default), text, pdf, docx, xlsx, csv, fields, hocr, altoThe output written to the response.
langen, fr, de, es, it, pt, nl, autoThe language model, or one chosen per page.
modefast, accurateReads with the accurate model when the package has one.
pdf_imagelossless, jpeg, bw, mrcHow the page image is stored in a searchable PDF.
redactall or email,ssn,phone,card,ibanBlacks out personal data in the response.

Everything else, from licence files to the C API, is in the user guide.

Build it in this week.

The trial package includes the libraries, the examples and the HTTP service.