mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-10 04:09:53 +02:00
commit
e7fb432e35
5 changed files with 32 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue