diff --git a/Makefile b/Makefile index 9fabd2e..d184ff5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,5 @@ -# '$(PYTHON)' -PYTHON = python - # '$(PIP_INSTALL)' -PIP_INSTALL = pip install +PIP_INSTALL = pip3 install # '$(GIT_CLONE)' GIT_CLONE = git clone @@ -17,7 +14,7 @@ help: @echo " calamari Clone calamari repo" @echo " calamari_models Clone calamari_models repo" @echo " calamari/build pip install calamari" - @echo " deps-test Install testing python deps via pip" + @echo " deps-test Install testing python deps via pip @echo " repo/assets Clone OCR-D/assets to ./repo/assets" @echo " test/assets Setup test assets" @echo " assets-clean Remove symlinks in test/assets" @@ -26,7 +23,6 @@ help: @echo "" @echo " Variables" @echo "" - @echo " PYTHON '$(PYTHON)'" @echo " PIP_INSTALL '$(PIP_INSTALL)'" @echo " GIT_CLONE '$(GIT_CLONE)'" @@ -51,6 +47,7 @@ calamari_models: calamari/build: calamari calamari_models cd calamari && $(PIP_INSTALL) . + # # Assets and Tests # diff --git a/README.md b/README.md index dca1ffc..f2081a7 100644 --- a/README.md +++ b/README.md @@ -13,19 +13,50 @@ This offers a OCR-D compliant workspace processor for some of the functionality This processor only operates on the text line level and so needs a line segmentation (and by extension a binarized image) as its input. -## Example Usage +## Installation + +### From PyPI + +``` +pip install ocrd_calamari +``` + +### From Repo ```sh -ocrd-calamari-recognize -p test-parameters.json -m mets.xml -I OCR-D-SEG-LINE -O OCR-D-OCR-CALAMARI +pip install . ``` -With `test-parameters.json`: +## Install models + +Download standard models: + +``` +wget https://github.com/Calamari-OCR/calamari_models/archive/master.zip +unzip master.zip +``` + +Download models trained on GT4HistOCR data: + +``` +wget https://file.spk-berlin.de:8443/calamari-models/GT4HistOCR/model.tar.xz +mkdir gt4hist-calamari +cd gt4hist-calamari +tar xf ../model.tar.xz +``` -```json +## Example Usage + +~~~ +ocrd-calamari-recognize -p test-parameters.json -m mets.xml -I OCR-D-SEG-LINE -O OCR-D-OCR-CALAMARI +~~~ + +With `test-parameters.json`: +~~~ { "checkpoint": "/path/to/some/trained/models/*.ckpt.json" } -``` +~~~ TODO ---- diff --git a/ocrd_calamari/cli.py b/ocrd_calamari/cli.py index 2a1e210..068b065 100644 --- a/ocrd_calamari/cli.py +++ b/ocrd_calamari/cli.py @@ -7,4 +7,7 @@ from ocrd_calamari.recognize import CalamariRecognize @click.command() @ocrd_cli_options def ocrd_calamari_recognize(*args, **kwargs): + """ + Run Calamari OCR multi-model recognition and voting + """ return ocrd_cli_wrap_processor(CalamariRecognize, *args, **kwargs)