diff --git a/README.md b/README.md index c5c85cd..f76e932 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,17 @@ 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 +------------- + +~~~ +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" +} +~~~ diff --git a/ocrd_calamari/ocrd-tool.json b/ocrd_calamari/ocrd-tool.json index 449c372..5fc5073 100644 --- a/ocrd_calamari/ocrd-tool.json +++ b/ocrd_calamari/ocrd-tool.json @@ -18,7 +18,7 @@ "OCR-D-OCR-CALAMARI" ], "parameters": { - "XXX checkpoint": {"type": "string", "format": "file", "cacheable": true}, + "checkpoint": {"type": "string", "format": "file", "cacheable": true}, "voter": {"type": "string", "default": "confidence_voter_default_ctc"} } } diff --git a/ocrd_calamari/recognize.py b/ocrd_calamari/recognize.py index f6e79f3..ad5f8ad 100644 --- a/ocrd_calamari/recognize.py +++ b/ocrd_calamari/recognize.py @@ -27,7 +27,7 @@ class CalamariRecognize(Processor): def _init_calamari(self): os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL - checkpoints = glob('/home/mike/devel/experiments/train-calamari-gt4histocr/models/*.ckpt.json') # XXX + checkpoints = glob(self.parameter['checkpoint']) self.predictor = MultiPredictor(checkpoints=checkpoints) voter_params = VoterParams()