From 5f23c03cd9ed85ce861f455818761261e5e3d05f Mon Sep 17 00:00:00 2001 From: Robert Sachunsky <38561704+bertsky@users.noreply.github.com> Date: Thu, 10 Feb 2022 17:41:51 +0100 Subject: [PATCH] recognize: remove checkpoint param in favour of checkpoint_dir alone --- ocrd_calamari/recognize.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ocrd_calamari/recognize.py b/ocrd_calamari/recognize.py index bf267d6..7620c9c 100644 --- a/ocrd_calamari/recognize.py +++ b/ocrd_calamari/recognize.py @@ -47,10 +47,8 @@ class CalamariRecognize(Processor): """ Set up the model prior to processing. """ - 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']) + resolved = self.resolve_resource(self.parameter['checkpoint_dir']) + checkpoints = glob('%s/*.ckpt.json' % resolved) self.predictor = MultiPredictor(checkpoints=checkpoints) self.network_input_channels = self.predictor.predictors[0].network.input_channels