From d6804bd9c3047956c90756baa554d849121861d5 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Tue, 22 Dec 2020 16:29:40 +0100 Subject: [PATCH] fix typos --- .gitignore | 1 + ocrd_calamari/recognize.py | 2 +- test/test_recognize.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4061f82..0bea6c4 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,4 @@ venv.bak/ /actevedef_718448162* /repo /test/assets +gt4histocr-calamari* diff --git a/ocrd_calamari/recognize.py b/ocrd_calamari/recognize.py index 102c927..6269e55 100644 --- a/ocrd_calamari/recognize.py +++ b/ocrd_calamari/recognize.py @@ -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['checkpoint_dir']: + 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) diff --git a/test/test_recognize.py b/test/test_recognize.py index 7926404..0a1e558 100644 --- a/test/test_recognize.py +++ b/test/test_recognize.py @@ -14,8 +14,8 @@ from .base import assets METS_KANT = assets.url_of('kant_aufklaerung_1784-page-region-line-word_glyph/data/mets.xml') WORKSPACE_DIR = '/tmp/test-ocrd-calamari' -CHECKPPOINT_DIR = os.path.join(os.getcwd(), 'gt4histocr-calamari1') -CHECKPOINT = os.path.join(CHECKPPOINT_DIR, '*.ckpt.json') +CHECKPOINT_DIR = os.path.join(os.getcwd(), 'gt4histocr-calamari1') +CHECKPOINT = os.path.join(CHECKPOINT_DIR, '*.ckpt.json') # Because XML namespace versions are so much fun, we not only use one, we use TWO! NSMAP = { "pc": "http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15" } @@ -88,7 +88,7 @@ def test_recognize_with_checkpoint_dir(workspace): input_file_grp="OCR-D-GT-SEG-LINE", output_file_grp="OCR-D-OCR-CALAMARI", parameter={ - "checkpoin_dir": CHECKPOINT_DIR, + "checkpoint_dir": CHECKPOINT_DIR, } ).process() workspace.save_mets()