Skip to main content

font recognition and OCR

Project description

ocrd_froc

Perform font classification and text recognition (in one step) on historic documents.

> Open and deserialize PAGE input files and their respective images,
> iterating over the element hierarchy down to the text line level.

> Then for each line, retrieve the raw image and feed it to the font
> classifier and/or the  OCR.

> Annotate font predictions by name and score as a comma-separated
> list under ``./TextStyle/@fontFamily``, if any.

> Annotate the text prediction as a string under ``./TextEquiv``.

> If ``method`` is `adaptive`, then use `SelOCR` if font classification is confident
> enough, otherwise use `COCR`.

> Finally, produce a new PAGE output file by serialising the resulting hierarchy.

Installation

Models

Default

The default.froc model is composed of a SelOCR network and a COCR architecture, and is trained to classify and OCR textlines on the following 12 classes:

  • Antiqua

  • Bastarda

  • Fraktur

  • Textura

  • Schwabacher

  • Greek *

  • Italic

  • Hebrew *

  • Gotico-antiqua

  • Manuscript *

  • Rotunda

  • No class/Ignore

* Greek, Hebrew and Manuscript font groups do not currently provide good results due to a lack of training data.

Usage

OCR-D processor interface ocrd-froc

To be used with PAGE-XML documents in an OCR-D annotation workflow.

Parameters:

   "ocr_method" [string - "none"]
    The method to use for text recognition
    Possible values: ["none", "SelOCR", "COCR", "adaptive"]
   "replace_textstyle" [bool - true]
    Whether to replace existing textStyle
   "network" [string]
    The file name of the neural network to use, including sufficient path
    information. Defaults to the model bundled with ocrd_froc.
   "fast_cocr" [boolean - true]
    Whether to use optimization steps on the COCR strategy
   "adaptive_treshold" [number - 95]
    Treshold of certitude needed to use SelOCR when using the adaptive
    strategy
   "font_class_priors" [array - []]
    List of font classes which are known to be present on the data when
    using the adaptive/SelOCR strategies. When this option is specified,
    every font classes not included will be ignored. If 'other' is
    included in the list, font classification will not be outputted and
    a generic model will be used for transcriptions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocrd_froc-0.5.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

ocrd_froc-0.5.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file ocrd_froc-0.5.0.tar.gz.

File metadata

  • Download URL: ocrd_froc-0.5.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for ocrd_froc-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a47b6a4b7f48fe03d7c8b7f2f5dbaab5d5020f04c11990d298069e544c6fc3ea
MD5 4e660551d2e4770cab9fefb6421514e2
BLAKE2b-256 851b30b0ee8e3dc810a196577a5182fec57a235cfc3c67c57362691b527303b0

See more details on using hashes here.

File details

Details for the file ocrd_froc-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: ocrd_froc-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for ocrd_froc-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69b20ea6f5702022ede1c67b1bbdc3cb8fb8c2931ea88bb7964caaec6a768584
MD5 a7d9c17d8f0e7a556e4513dc2af72a7f
BLAKE2b-256 2517358c888fcbae0da2fb6477373a39f4a5e236839320afa9d8b982bf445262

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page