use Processor.resolve_files to handle on-demand download of models via registry

fix/readme-no-checkpoint
Konstantin Baierer 4 years ago
parent d6804bd9c3
commit 00e43b1d1f

@ -41,7 +41,8 @@ class CalamariRecognize(Processor):
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.get('checkpoint_dir', None): if self.parameter.get('checkpoint_dir', None):
self.parameter['checkpoint'] = '%s/*.ckpt.json' % self.parameter['checkpoint_dir'] resolved = self.resolve_resource(self.parameter['checkpoint_dir'])
self.parameter['checkpoint'] = '%s/*.ckpt.json' % resolved
checkpoints = glob(self.parameter['checkpoint']) checkpoints = glob(self.parameter['checkpoint'])
self.predictor = MultiPredictor(checkpoints=checkpoints) self.predictor = MultiPredictor(checkpoints=checkpoints)

@ -3,4 +3,4 @@ tensorflow >= 2.3.0rc2
calamari-ocr == 1.0.* calamari-ocr == 1.0.*
setuptools >= 41.0.0 # tensorboard depends on this, but why do we get an error at runtime? setuptools >= 41.0.0 # tensorboard depends on this, but why do we get an error at runtime?
click click
ocrd >= 2.13.0 ocrd >= 2.22.0

Loading…
Cancel
Save