From 4cf25b81195ca6e81e9a73f9d6123daafdccfd3e Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Tue, 9 Feb 2021 18:20:46 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Rename=20input=5Fchannels=20vari?= =?UTF-8?q?able=20to=20network=5Finput=5Fchannels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ocrd_calamari/recognize.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocrd_calamari/recognize.py b/ocrd_calamari/recognize.py index 5c6807e..817d6d5 100644 --- a/ocrd_calamari/recognize.py +++ b/ocrd_calamari/recognize.py @@ -48,10 +48,10 @@ class CalamariRecognize(Processor): checkpoints = glob(self.parameter['checkpoint']) self.predictor = MultiPredictor(checkpoints=checkpoints) - self.input_channels = self.predictor.predictors[0].network.input_channels - #self.input_channels = self.predictor.predictors[0].network_params.channels # not used! + self.network_input_channels = self.predictor.predictors[0].network.input_channels + #self.network_input_channels = self.predictor.predictors[0].network_params.channels # not used! # binarization = self.predictor.predictors[0].model_params.data_preprocessor.binarization # not used! - # self.features = ('' if self.input_channels != 1 else + # self.features = ('' if self.network_input_channels != 1 else # 'binarized' if binarization != 'GRAY' else # 'grayscale_normalized') self.features = '' @@ -91,7 +91,7 @@ class CalamariRecognize(Processor): log.debug("Recognizing line '%s' in region '%s'", line.id, region.id) line_image, line_coords = self.workspace.image_from_segment(line, region_image, region_coords, feature_selector=self.features) - if ('binarized' not in line_coords['features'] and 'grayscale_normalized' not in line_coords['features'] and self.input_channels == 1): + if ('binarized' not in line_coords['features'] and 'grayscale_normalized' not in line_coords['features'] and self.network_input_channels == 1): # We cannot use a feature selector for this since we don't # know whether the model expects (has been trained on) # binarized or grayscale images; but raw images are likely