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

define default for checkpoint_dir, but allow checkpoint still

This commit is contained in:
Konstantin Baierer 2021-01-27 13:59:45 +01:00
parent 00e43b1d1f
commit 03f5e44e62
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@
"parameters": {
"checkpoint_dir": {
"description": "The directory containing calamari model files (*.ckpt.json). Uses all checkpoints in that directory",
"type": "string", "format": "file", "cacheable": true
"type": "string", "format": "file", "cacheable": true, "default": "qurator-gt4histocr-1.0"
},
"checkpoint": {
"description": "The calamari model files (*.ckpt.json)",

View file

@ -40,7 +40,7 @@ class CalamariRecognize(Processor):
def _init_calamari(self):
os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL
if self.parameter.get('checkpoint_dir', None):
if not self.parameter.get('checkpoint', None) and self.parameter.get('checkpoint_dir', None):
resolved = self.resolve_resource(self.parameter['checkpoint_dir'])
self.parameter['checkpoint'] = '%s/*.ckpt.json' % resolved
checkpoints = glob(self.parameter['checkpoint'])