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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ocrd_typegroups_classifier-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c9b0f8253a2b34985128201ff155329ce23a5094e21f5f162d9ffa12ce8230b |
|
MD5 | 4e597d6a3f75c4991392b11e88f89f40 |
|
BLAKE2b-256 | 136cad140f1e282941da373f19236cfffdc7b4dfe8190cef547175d33c3de8d9 |
Hashes for ocrd_typegroups_classifier-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75057c3c0c8be6f664f04c903ce3fd4337a5f87dea8c825a423e006a2c406a03 |
|
MD5 | 733fcd5009cf54a7349aa314bf9a6e47 |
|
BLAKE2b-256 | bc821b0976ef56d24962249dd9c4ff1c8dff259413cb52cc99bb08bbea15e1f8 |