mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-06-17 23:59:59 +02:00
Revert "Merge branch 'master' of https://github.com/qurator-spk/sbb_textline_detector"
This reverts commit 2c89bf3b35ee290d7b830ef270df3a96aa48245e, reversing changes made to 9f7e413148ca5dbac9b555d7b0d0a5fa3a0f5340.
This commit is contained in:
parent
1303a7d92f
commit
48a31ce672
73 changed files with 64834 additions and 1686 deletions
65
README.md
65
README.md
|
@ -1,30 +1,49 @@
|
|||
# Textline Detection
|
||||
dinglehopper
|
||||
============
|
||||
|
||||
## Introduction
|
||||
This tool performs textline detection from document image data and returns the results as PAGE-XML.
|
||||
dinglehopper is an OCR evaluation tool and reads [ALTO](https://github.com/altoxml), [PAGE](https://github.com/PRImA-Research-Lab/PAGE-XML) and text files.
|
||||
|
||||
## Installation
|
||||
[](https://travis-ci.org/qurator-spk/dinglehopper)
|
||||
|
||||
`pip install .`
|
||||
|
||||
## Models
|
||||
In order to run this tool you also need trained models. You can download our pre-trained models from here:
|
||||
https://file.spk-berlin.de:8443/textline_detection/
|
||||
|
||||
## Usage
|
||||
|
||||
`sbb_textline_detector -i <image file name> -o <directory to write output xml> -m <directory of models>`
|
||||
|
||||
## Usage with OCR-D
|
||||
Goals
|
||||
-----
|
||||
* Useful
|
||||
* As a UI tool
|
||||
* For an automated evaluation
|
||||
* As a library
|
||||
* Unicode support
|
||||
|
||||
Installation
|
||||
------------
|
||||
It's best to use pip, e.g.:
|
||||
~~~
|
||||
ocrd-example-binarize -I OCR-D-IMG -O OCR-D-IMG-BIN
|
||||
ocrd-sbb-textline-detector -I OCR-D-IMG-BIN -O OCR-D-SEG-LINE-SBB \
|
||||
-p '{ "model": "/path/to/the/models/textline_detection" }'
|
||||
sudo pip install .
|
||||
~~~
|
||||
|
||||
Segmentation works on raw RGB images, but respects and retains
|
||||
`AlternativeImage`s from binarization steps, so it's a good idea to do
|
||||
binarization first, then perform the textline detection. The used binarization
|
||||
processor must produce an `AlternativeImage` for the binarized image, not
|
||||
replace the original raw RGB image.
|
||||
Usage
|
||||
-----
|
||||
~~~
|
||||
dinglehopper some-document.gt.page.xml some-document.ocr.alto.xml
|
||||
~~~
|
||||
This generates `report.html` and `report.json`.
|
||||
|
||||
|
||||
As a OCR-D processor:
|
||||
~~~
|
||||
ocrd-dinglehopper -m mets.xml -I OCR-D-GT-PAGE,OCR-D-OCR-TESS -O OCR-D-OCR-TESS-EVAL
|
||||
~~~
|
||||
This generates HTML and JSON reports in the `OCR-D-OCR-TESS-EVAL` filegroup.
|
||||
|
||||
|
||||

|
||||
|
||||
Testing
|
||||
-------
|
||||
Use `pytest` to run the tests in [the tests directory](qurator/dinglehopper/tests):
|
||||
~~~
|
||||
virtualenv -p /usr/bin/python3 venv
|
||||
. venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
pip install pytest
|
||||
pytest
|
||||
~~~
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue