mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-09 19:59:53 +02:00
Merge pull request #15 from OCR-D/doc
README/Makefile: installation and models
This commit is contained in:
commit
8bea30a051
3 changed files with 43 additions and 12 deletions
9
Makefile
9
Makefile
|
@ -1,8 +1,5 @@
|
||||||
# '$(PYTHON)'
|
|
||||||
PYTHON = python
|
|
||||||
|
|
||||||
# '$(PIP_INSTALL)'
|
# '$(PIP_INSTALL)'
|
||||||
PIP_INSTALL = pip install
|
PIP_INSTALL = pip3 install
|
||||||
|
|
||||||
# '$(GIT_CLONE)'
|
# '$(GIT_CLONE)'
|
||||||
GIT_CLONE = git clone
|
GIT_CLONE = git clone
|
||||||
|
@ -17,7 +14,7 @@ help:
|
||||||
@echo " calamari Clone calamari repo"
|
@echo " calamari Clone calamari repo"
|
||||||
@echo " calamari_models Clone calamari_models repo"
|
@echo " calamari_models Clone calamari_models repo"
|
||||||
@echo " calamari/build pip install calamari"
|
@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 " repo/assets Clone OCR-D/assets to ./repo/assets"
|
||||||
@echo " test/assets Setup test assets"
|
@echo " test/assets Setup test assets"
|
||||||
@echo " assets-clean Remove symlinks in test/assets"
|
@echo " assets-clean Remove symlinks in test/assets"
|
||||||
|
@ -26,7 +23,6 @@ help:
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " Variables"
|
@echo " Variables"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " PYTHON '$(PYTHON)'"
|
|
||||||
@echo " PIP_INSTALL '$(PIP_INSTALL)'"
|
@echo " PIP_INSTALL '$(PIP_INSTALL)'"
|
||||||
@echo " GIT_CLONE '$(GIT_CLONE)'"
|
@echo " GIT_CLONE '$(GIT_CLONE)'"
|
||||||
|
|
||||||
|
@ -51,6 +47,7 @@ calamari_models:
|
||||||
calamari/build: calamari calamari_models
|
calamari/build: calamari calamari_models
|
||||||
cd calamari && $(PIP_INSTALL) .
|
cd calamari && $(PIP_INSTALL) .
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Assets and Tests
|
# Assets and Tests
|
||||||
#
|
#
|
||||||
|
|
43
README.md
43
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
|
This processor only operates on the text line level and so needs a line segmentation (and by extension a binarized
|
||||||
image) as its input.
|
image) as its input.
|
||||||
|
|
||||||
## Example Usage
|
## Installation
|
||||||
|
|
||||||
```sh
|
### From PyPI
|
||||||
ocrd-calamari-recognize -p test-parameters.json -m mets.xml -I OCR-D-SEG-LINE -O OCR-D-OCR-CALAMARI
|
|
||||||
|
```
|
||||||
|
pip install ocrd_calamari
|
||||||
```
|
```
|
||||||
|
|
||||||
With `test-parameters.json`:
|
### From Repo
|
||||||
|
|
||||||
```json
|
```sh
|
||||||
|
pip install .
|
||||||
|
```
|
||||||
|
|
||||||
|
## 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
|
||||||
|
```
|
||||||
|
|
||||||
|
## 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"
|
"checkpoint": "/path/to/some/trained/models/*.ckpt.json"
|
||||||
}
|
}
|
||||||
```
|
~~~
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
----
|
----
|
||||||
|
|
|
@ -7,4 +7,7 @@ from ocrd_calamari.recognize import CalamariRecognize
|
||||||
@click.command()
|
@click.command()
|
||||||
@ocrd_cli_options
|
@ocrd_cli_options
|
||||||
def ocrd_calamari_recognize(*args, **kwargs):
|
def ocrd_calamari_recognize(*args, **kwargs):
|
||||||
|
"""
|
||||||
|
Run Calamari OCR multi-model recognition and voting
|
||||||
|
"""
|
||||||
return ocrd_cli_wrap_processor(CalamariRecognize, *args, **kwargs)
|
return ocrd_cli_wrap_processor(CalamariRecognize, *args, **kwargs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue