mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-10 04:09:53 +02:00
implement "checkpoint_dir" parameter as a simpler alternative to "checkpoint"
This commit is contained in:
parent
fe973e58db
commit
83adfcfd5a
4 changed files with 31 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
|
||||
|
|
|
@ -40,6 +40,8 @@ class CalamariRecognize(Processor):
|
|||
def _init_calamari(self):
|
||||
os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL
|
||||
|
||||
if self.parameter['checkpoint_dir']:
|
||||
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