1
0
Fork 0
mirror of https://github.com/mikegerber/ocrd_calamari.git synced 2025-06-10 04:09:53 +02:00

Merge pull request #52 from OCR-D/checkpoint_dir

Checkpoint dir
This commit is contained in:
Mike Gerber 2021-01-19 11:59:15 +01:00 committed by GitHub
commit e7fb432e35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 1 deletions

View file

@ -18,6 +18,10 @@
"OCR-D-OCR-CALAMARI"
],
"parameters": {
"checkpoint_dir": {
"description": "The directory containing calamari model files (*.ckpt.json). Uses all checkpoints in that directory",
"type": "string", "format": "file", "cacheable": true
},
"checkpoint": {
"description": "The calamari model files (*.ckpt.json)",
"type": "string", "format": "file", "cacheable": true

View file

@ -42,6 +42,8 @@ class CalamariRecognize(Processor):
def _init_calamari(self):
if self.parameter.get('checkpoint_dir', None):
self.parameter['checkpoint'] = '%s/*.ckpt.json' % self.parameter['checkpoint_dir']
checkpoints = glob(self.parameter['checkpoint'])
self.predictor = MultiPredictor(checkpoints=checkpoints)