Merge pull request #15 from OCR-D/doc

README/Makefile: installation and models
fix/readme-no-checkpoint
Mike Gerber 5 years ago committed by GitHub
commit 8bea30a051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
#

@ -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
----

@ -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)

Loading…
Cancel
Save