recognize: remove checkpoint param in favour of checkpoint_dir alone

fix/readme-no-checkpoint
Robert Sachunsky 3 years ago committed by GitHub
parent 11615be6b2
commit 5f23c03cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save