Skip to content

Commit

Permalink
define default for checkpoint_dir, but allow checkpoint still
Browse files Browse the repository at this point in the history
  • Loading branch information
kba committed Jan 27, 2021
1 parent 00e43b1 commit 03f5e44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ocrd_calamari/ocrd-tool.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
2 changes: 1 addition & 1 deletion ocrd_calamari/recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, *args, **kwargs):
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'])
Expand Down

0 comments on commit 03f5e44

Please sign in to comment.