fix typos

fix/readme-no-checkpoint
Konstantin Baierer 4 years ago
parent 83adfcfd5a
commit d6804bd9c3

1
.gitignore vendored

@ -110,3 +110,4 @@ venv.bak/
/actevedef_718448162* /actevedef_718448162*
/repo /repo
/test/assets /test/assets
gt4histocr-calamari*

@ -40,7 +40,7 @@ class CalamariRecognize(Processor):
def _init_calamari(self): def _init_calamari(self):
os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL 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'] self.parameter['checkpoint'] = '%s/*.ckpt.json' % self.parameter['checkpoint_dir']
checkpoints = glob(self.parameter['checkpoint']) checkpoints = glob(self.parameter['checkpoint'])
self.predictor = MultiPredictor(checkpoints=checkpoints) self.predictor = MultiPredictor(checkpoints=checkpoints)

@ -14,8 +14,8 @@ from .base import assets
METS_KANT = assets.url_of('kant_aufklaerung_1784-page-region-line-word_glyph/data/mets.xml') METS_KANT = assets.url_of('kant_aufklaerung_1784-page-region-line-word_glyph/data/mets.xml')
WORKSPACE_DIR = '/tmp/test-ocrd-calamari' WORKSPACE_DIR = '/tmp/test-ocrd-calamari'
CHECKPPOINT_DIR = os.path.join(os.getcwd(), 'gt4histocr-calamari1') CHECKPOINT_DIR = os.path.join(os.getcwd(), 'gt4histocr-calamari1')
CHECKPOINT = os.path.join(CHECKPPOINT_DIR, '*.ckpt.json') CHECKPOINT = os.path.join(CHECKPOINT_DIR, '*.ckpt.json')
# Because XML namespace versions are so much fun, we not only use one, we use TWO! # 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" } 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", input_file_grp="OCR-D-GT-SEG-LINE",
output_file_grp="OCR-D-OCR-CALAMARI", output_file_grp="OCR-D-OCR-CALAMARI",
parameter={ parameter={
"checkpoin_dir": CHECKPOINT_DIR, "checkpoint_dir": CHECKPOINT_DIR,
} }
).process() ).process()
workspace.save_mets() workspace.save_mets()

Loading…
Cancel
Save