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.2.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ocrd_froc-0.5.2.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.2.tar.gz
Algorithm Hash digest
SHA256 dbdd42d118625860bc2545af487e3e6c69a1af43df41c317d2e2dc814810e1da
MD5 6db860d6cdf330c427747e8135a32a78
BLAKE2b-256 0b69775336c3f227c48e2af670d46b78c96485f0819bdf154c6b709c2fb602a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ocrd_froc-0.5.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 312843680c9bb324e0f0c8170e19d76d61f6fa91d49bda6003203c635d43acb9
MD5 4513eba8f41aa89c001239d68212ed18
BLAKE2b-256 91807f925436ae3e2c84ed7a2f8fe55478b8009de78768e262270653e1fd91f3

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