Skip to main content

Typegroups classifier for OCR

Project description

ocrd_typegroups_classifier

Typegroups classifier for OCR

Installation

From PyPI

pip3 install ocrd_typegroup_classifier

From source

If needed, create a virtual environment for Python 3 (it was tested successfully with Python 3.7), activate it, and install ocrd.

virtualenv -p python3 ocrd-venv3
source ocrd-venv3/bin/activate
pip3 install ocrd

Enter in the folder containing the tool:

cd ocrd_typegroups_classifier/

Install the module and its dependencies

make install

Finally, run the test:

sh test/test.sh

** Important: ** The test makes sure that the system does work. For speed reasons, a very small neural network is used and applied only to the top-left corner of the image, therefore the quality of the results will be of poor quality.

Models

The model classifier-1.tgc is based on a ResNet-18, with less neurons per layer than the usual model. It was briefly trained on 12 classes: Adornment, Antiqua, Bastarda, Book covers and other irrelevant data, Empty Pages, Fraktur, Griechisch, Hebräisch, Kursiv, Rotunda, Textura, and Woodcuts - Engravings.

Heatmap Generation

Given a trained model, it is possible to produce heatmaps corresponding to classification results. Syntax:

python3 tools/heatmap.py ocrd_typegroups_classifier/models/classifier.tgc sample.jpg out

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_typegroups_classifier-0.0.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

ocrd_typegroups_classifier-0.0.1-py3-none-any.whl (26.3 MB view details)

Uploaded Python 3

File details

Details for the file ocrd_typegroups_classifier-0.0.1.tar.gz.

File metadata

  • Download URL: ocrd_typegroups_classifier-0.0.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.9

File hashes

Hashes for ocrd_typegroups_classifier-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6b339f6b52cb62acc93f64d11637aa895a2cfbe7958df3391e4d6480d8c87d28
MD5 48c202c02d301243c8e9f365e9dcad1d
BLAKE2b-256 6ad0620fd50f319ef68ec959b67d0c048bb0f1d602ca5cc0baa0ff46fd235382

See more details on using hashes here.

File details

Details for the file ocrd_typegroups_classifier-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ocrd_typegroups_classifier-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 26.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.9

File hashes

Hashes for ocrd_typegroups_classifier-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d469964e37069a2dab403bbf7400eec4ddabcf4ee83c86d6e88bda1bd96e9c1d
MD5 19437f8f76a7e346479a2bea163b164f
BLAKE2b-256 e61b5d0e6967985a7e23d01f558677bd7de4385dacc0186e4896ad23cb4e2f0d

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