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_threshold" [number - 95]
    Threshold 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. If this option is specified,
    any font classes not included are ignored. If 'other' is
    included in the list, no font classification is output and
    a generic model is 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.6.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

ocrd_froc-0.6.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ocrd_froc-0.6.1.tar.gz
  • Upload date:
  • Size: 15.8 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.6.1.tar.gz
Algorithm Hash digest
SHA256 d01ea0aba6c10804522ef5d1e7c5ae3f4c22b1c0485c0091dd59eaa5fa929445
MD5 c6c58169f16ea182ad0b4b9fccc42aa1
BLAKE2b-256 cc2272d73dbafb06428c7c40376f9cf2165196094f7b3797418e31ce612ac654

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ocrd_froc-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 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.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0721a3b142bfd4fac9759b416d382f67794f6453b00ad1b9c94bddd8318c4fc0
MD5 843b9864c58adc2b633a300d7a286edf
BLAKE2b-256 7490d79e4a9bc040ad7b73d5e4d1e9fbd35b6be9d4881801bbe29662d6515df4

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