mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-09 19:59:53 +02:00
🚧 Do not hardcode used models
This commit is contained in:
parent
8cfb075a6d
commit
ebf0d53640
3 changed files with 16 additions and 2 deletions
14
README.md
14
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
|
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
|
||||||
|
-------------
|
||||||
|
|
||||||
|
~~~
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
~~~
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
"OCR-D-OCR-CALAMARI"
|
"OCR-D-OCR-CALAMARI"
|
||||||
],
|
],
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"XXX checkpoint": {"type": "string", "format": "file", "cacheable": true},
|
"checkpoint": {"type": "string", "format": "file", "cacheable": true},
|
||||||
"voter": {"type": "string", "default": "confidence_voter_default_ctc"}
|
"voter": {"type": "string", "default": "confidence_voter_default_ctc"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ class CalamariRecognize(Processor):
|
||||||
def _init_calamari(self):
|
def _init_calamari(self):
|
||||||
os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL
|
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)
|
self.predictor = MultiPredictor(checkpoints=checkpoints)
|
||||||
|
|
||||||
voter_params = VoterParams()
|
voter_params = VoterParams()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue