No description
Find a file
2023-08-17 19:59:48 +02:00
.github ✔ Run test scripts during the build (WIP) 2023-08-15 20:25:20 +02:00
wrapper 🚧 Add WIP support for ocrd_trocr 2023-04-05 11:57:52 +02:00
.gitignore 🧹 .gitignore build/ 2023-03-20 16:49:02 +01:00
build 🚧 Update to CUDA 12.1 (10.x is not available anymore) 2023-08-08 12:09:33 +02:00
Dockerfile-core 🐛 core: Install pkg-config (to fix ocrd_olena build) 2023-08-08 12:29:34 +02:00
Dockerfile-core-cuda12.1 🐛 core: Install pkg-config (to fix ocrd_olena build) 2023-08-08 12:29:34 +02:00
Dockerfile-dinglehopper ⚙ Install dinglehopper from PyPI 2023-08-07 19:45:29 +02:00
Dockerfile-eynollah ⬆ eynollah 0.3.0 2023-08-08 12:48:51 +02:00
Dockerfile-ocrd_anybaseocr 🚧 Update to CUDA 12.1 (10.x is not available anymore) 2023-08-08 12:09:33 +02:00
Dockerfile-ocrd_calamari 🚧 Update to CUDA 12.1 (10.x is not available anymore) 2023-08-08 12:09:33 +02:00
Dockerfile-ocrd_calamari03 🚧 Update to CUDA 12.1 (10.x is not available anymore) 2023-08-08 12:09:33 +02:00
Dockerfile-ocrd_cis 🧹 Use GIT_COMMIT, not DRONE_COMMIT 2023-03-15 17:04:59 +01:00
Dockerfile-ocrd_fileformat 🧹 Use GIT_COMMIT, not DRONE_COMMIT 2023-03-15 17:04:59 +01:00
Dockerfile-ocrd_olena 🐛 ocrd_olena: Update dependency installation 2023-08-14 20:00:00 +02:00
Dockerfile-ocrd_segment ⬆ ocrd_segment 0.1.22 2023-08-17 19:59:48 +02:00
Dockerfile-ocrd_tesserocr 🐛 ocrd_tesserocr: Use Ubuntu's own tesseract, not alex-p's 2023-08-08 12:35:18 +02:00
Dockerfile-ocrd_trocr 🚧 Add WIP support for ocrd_trocr 2023-04-05 11:57:52 +02:00
Dockerfile-ocrd_wrap 🧹 Use GIT_COMMIT, not DRONE_COMMIT 2023-03-15 17:04:59 +01:00
Dockerfile-sbb_binarization ⬆ sbb_binarization 0.1.0 2023-08-17 19:41:01 +02:00
Dockerfile-sbb_textline_detector 🚧 Update to CUDA 12.1 (10.x is not available anymore) 2023-08-08 12:09:33 +02:00
LICENSE ⚖️ Add a LICENSE file 2021-02-11 16:21:28 +01:00
my_ocrd_workflow ⬆️ ocrd_calamari 1.0.5 2022-09-16 18:31:11 +02:00
my_ocrd_workflow-sbb ⬆️ ocrd_calamari 1.0.5 2022-09-16 18:31:11 +02:00
ocrd-workspace-from-images ocrd-workspace-from-images 2020-10-09 16:50:12 +02:00
ppn2ocr 🐛 ppn2ocr: Don't break now that we have IIIF URLs 2022-04-07 18:12:49 +02:00
qurator_data_lib.sh 🚧 Try out Drone CI 2021-02-11 16:48:52 +01:00
README-DEV.md ✒ README-DEV: How to test the GitHub Action builds 2023-08-17 18:15:13 +02:00
README.md ✒ README: Update that we have images again + how to download models 2023-03-15 19:40:43 +01:00
requirements-ppn2ocr.txt 🚧 Add a script that checks FULLTEXT dimensions against BEST dimensions 2020-06-18 10:49:31 +02:00
test-core-cuda12.1.sh ✔ Add test for core-cuda12.1 2023-08-16 14:47:41 +02:00
test-core.sh ✔ Add test for core 2023-08-07 19:29:33 +02:00
test-dinglehopper.sh ✔ Add test for dinglehopper 2023-08-07 19:44:46 +02:00
test-eynollah.sh ✔ Add test-eynollah.sh 2023-08-15 19:51:42 +02:00
test-ocrd_cis.sh ✔ Use same "poor man's fixture" for all tests 2023-08-17 18:37:22 +02:00
test-ocrd_fileformat.sh ✔ Add test-ocrd_fileformat.sh 2023-08-17 18:06:48 +02:00
test-ocrd_olena.sh ✔ Use same "poor man's fixture" for all tests 2023-08-17 18:37:22 +02:00
test-ocrd_segment.sh ✔ Add test-ocrd_segment.sh 2023-08-17 19:55:52 +02:00
test-ocrd_tesserocr.sh ✔ Use same "poor man's fixture" for all tests 2023-08-17 18:37:22 +02:00
test-ocrd_trocr.sh ✔ Use same "poor man's fixture" for all tests 2023-08-17 18:37:22 +02:00
test-ocrd_wrap.sh ✔ Add test-ocrd_wrap.sh 2023-08-17 19:03:10 +02:00
test-sbb_binarization.sh ✔ Add test-sbb_binarization.sh 2023-08-17 19:40:26 +02:00
test-sbb_textline_detector.sh ✔ Add test-sbb_textline_detector.sh 2023-08-17 19:47:41 +02:00
zdb2ocr 🚧 zdb2ocr: Add TODOs from notes.md 2020-05-22 13:49:34 +02:00

ocrd-galley

A Dockerized test environment for OCR-D processors 🚢

WIP. Given a OCR-D workspace with document images in the OCR-D-IMG file group, the example workflow produces:

  • Binarized images
  • Line segmentation
  • OCR text (using Calamari and Tesseract, both with GT4HistOCR models)
  • (Given ground truth in OCR-D-GT-PAGE, also an OCR text evaluation report)

If you're interested in the exact processors, versions and parameters, please take a look at the script and possibly the individual Dockerfiles.

Goal

Provide a test environment to produce OCR output for historical prints, using OCR-D, especially ocrd_calamari and sbb_textline_detection, including all dependencies in Docker.

How to use

ocrd-galley uses Docker to run the OCR-D images. We provide pre-built container images that get downloaded automatically when you run the provided wrappers for the OCR-D processors.

You can then install the wrappers into a Python venv:

cd ~/devel/ocrd-galley/wrapper
pip install .

To download models, you need to use the -a flag of ocrd resmgr:

ocrd resmgr download -a ocrd-calamari-recognize default

You may then use the script my_ocrd_workflow to use your self-built containers on an example workspace:

# Download an example workspace
cd /tmp
wget https://qurator-data.de/examples/actevedef_718448162.first-page.zip
unzip actevedef_718448162.first-page.zip

# Run the workflow on it
cd actevedef_718448162.first-page
~/devel/ocrd-galley/my_ocrd_workflow

Viewing results

You may then examine the results using PRImA's PAGE Viewer:

java -jar /path/to/JPageViewer.jar \
  --resolve-dir . \
  OCR-D-OCR-CALAMARI/OCR-D-OCR-CALAMARI_00000024.xml

The example workflow also produces OCR evaluation reports using dinglehopper, if ground truth was available:

firefox OCR-D-OCR-CALAMARI-EVAL/OCR-D-OCR-CALAMARI-EVAL_00000024.html

ppn2ocr

The ppn2ocr script produces a workspace and METS file with the best images for a given document in the Berlin State Library (SBB)'s digitized collection.

Install it with an up-to-date pip (otherwise this will fail due to a opencv-python-headless build failure):

pip install -r ~/devel/ocrd-galley/requirements-ppn2ocr.txt

The document must be specified by its PPN, for example:

~/devel/ocrd-galley/ppn2ocr PPN77164308X
cd PPN77164308X
~/devel/ocrd-galley/my_ocrd_workflow -I MAX --skip-validation

This produces a workspace directory PPN77164308X with the OCR results in it; the results are viewable as explained above.

ppn2ocr requires properly set up environment variables for the proxy configuration. At SBB, please read howto/docker-proxy.md and howto/proxy-settings-for-shell+python.md (in qurator's mono-repo).

ocrd-workspace-from-images

The ocrd-workspace-from-images script produces a OCR-D workspace (incl. METS) for the given images.

~/devel/ocrd-galley/ocrd-workspace-from-images 0005.png
cd workspace-xxxxx  # output by the last command
~/devel/ocrd-galley/my_ocrd_workflow

This produces a workspace from the files and then runs the OCR workflow on it.

Build the containers yourself

To build the containers yourself using Docker:

cd ~/devel/ocrd-galley/
./build