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-1.1.0.tar.gz (81.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocrd_froc-1.1.0-py3-none-any.whl (81.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ocrd_froc-1.1.0.tar.gz
  • Upload date:
  • Size: 81.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ocrd_froc-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d5c9b15d5571a00727154e95b1b3d2f4fd0c2bc0a39ae0e0292a224746f7939e
MD5 4dd810715a2a05ab770d9d4259635be9
BLAKE2b-256 0b7550dd9ac9475269199ae486fb59f0013f5d6dfd97d52582eecb0f186f9d63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ocrd_froc-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 81.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ocrd_froc-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6048985d195887324adca3ef374e8e014336dd921de60b14a4b5cf0c19c6589e
MD5 744951965ec5113a4efdf246c52f8cc2
BLAKE2b-256 a36f8fe380ee48eb3a0665f0570df6c51b051709ab3fed3b7a782122ee7d0822

See more details on using hashes here.

Supported by

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