You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Gerber, Mike f2ed0b5cbf 🧹 Travis: Remove extra "set -e" 4 years ago
data@bd1628e1ae 🚧 Prepare supporting ocrd-sbb-binarize 4 years ago
ocrd-bugs 🐛 ocrd-bugs: Most/All workspaces in bag files don't validate 5 years ago
.gitignore 🧹 .gitignore __pychache__/*.pyc 4 years ago
.gitmodules Run Calamari OCR 5 years ago
.travis.yml 🧹 Travis: Remove extra "set -e" 4 years ago
Dockerfile-core ⚙️ Make minimal ocrd version a build arg 4 years ago
Dockerfile-dinglehopper ⬆️ Update dinglehopper (to fix bug related to find_files() being a generator now) 4 years ago
Dockerfile-ocrd_calamari 🐛 Consistently use pip install --use-feature=2020-resolver 4 years ago
Dockerfile-ocrd_cis 🚧 Add ocrd_cis (WIP) 4 years ago
Dockerfile-ocrd_fileformat 👷🏾‍♂️ Fix ocrd_fileformat (GH-34) 4 years ago
Dockerfile-ocrd_olena ⚙️ Use Docker build ARGs for build args 4 years ago
Dockerfile-ocrd_tesserocr ⚙️ Use Docker build ARGs for build args 4 years ago
Dockerfile-sbb_binarization 🚧 Update sbb_binarization 4 years ago
Dockerfile-sbb_textline_detector 🐛 Work around sbb_textline_detection#50 by downgrading h5py to <3 4 years ago
README-DEV.md 📝 README-DEV: Also push master, not only tags... 4 years ago
README.md 📝 README: s/my_ocrd_workflow/ocrd-galley (where appropiate) 4 years ago
build 🚧 Add ocrd_fileformat (WIP, see GH-34) 4 years ago
my_ocrd_workflow 📝 Add an example ALTO transformation to default workflow (Closes GH-34) 4 years ago
ocrd-workspace-from-images ocrd-workspace-from-images 4 years ago
ppn2ocr 🎨 ppn2ocr: Fix some whitespace code style issues 4 years ago
qurator_data_lib.sh 🚧 Prepare supporting ocrd-sbb-binarize 4 years ago
requirements-ppn2ocr.txt 🚧 Add a script that checks FULLTEXT dimensions against BEST dimensions 4 years ago
run 🐛 Fix ocrd-fileformat-transform alias 4 years ago
run-docker-hub Allow running pre-built containers again 4 years ago
run-docker-hub-update 🐳 run-docker-hub-update: Update to the latest containers 4 years ago
zdb2ocr 🚧 zdb2ocr: Add TODOs from notes.md 4 years ago

README.md

ocrd-galley

Build Status

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

It's easiest to use it as pre-built containers. To run the containers on an example workspace:

# Update to the latest stable containers
(cd ~/devel/ocrd-galley/; ./run-docker-hub-update)

# 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/run-docker-hub

Build the containers yourself

To build the containers yourself using Docker:

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

You may then use the script run to use your self-built containers, analogous to the example above.

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 State Library Berlin (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/run-docker-hub -I BEST --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/run-docker-hub

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