From 4671e982e51f8b9924c75d6632d4bea86f0b4cea Mon Sep 17 00:00:00 2001 From: Robert Sachunsky <38561704+bertsky@users.noreply.github.com> Date: Wed, 14 Aug 2024 00:25:38 +0200 Subject: [PATCH] remove fileGrp cardinality assertions --- ocrd_kraken/binarize.py | 5 ----- ocrd_kraken/recognize.py | 4 +--- ocrd_kraken/segment.py | 2 -- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/ocrd_kraken/binarize.py b/ocrd_kraken/binarize.py index 809a919..c4379bc 100644 --- a/ocrd_kraken/binarize.py +++ b/ocrd_kraken/binarize.py @@ -17,11 +17,6 @@ class KrakenBinarize(Processor): def executable(self): return 'ocrd-kraken-binarize' - def setup(self): - self.logger = getLogger('processor.KrakenBinarize') - assert_file_grp_cardinality(self.input_file_grp, 1) - assert_file_grp_cardinality(self.output_file_grp, 1) - def process_page_pcgts(self, *input_pcgts : OcrdPage, output_file_id : Optional[str] = None, page_id : Optional[str] = None) -> OcrdPage: """Binarize the pages/regions/lines with Kraken. diff --git a/ocrd_kraken/recognize.py b/ocrd_kraken/recognize.py index a0773d1..dea439a 100644 --- a/ocrd_kraken/recognize.py +++ b/ocrd_kraken/recognize.py @@ -54,10 +54,8 @@ def executable(self): def setup(self): """ - Assert filegrp cardinality, load model, set predict function + Load model, set predict function """ - assert_file_grp_cardinality(self.input_file_grp, 1) - assert_file_grp_cardinality(self.output_file_grp, 1) self.logger = getLogger('processor.KrakenRecognize') import torch diff --git a/ocrd_kraken/segment.py b/ocrd_kraken/segment.py index bdce58f..5b8fe4b 100644 --- a/ocrd_kraken/segment.py +++ b/ocrd_kraken/segment.py @@ -45,8 +45,6 @@ def setup(self): Load models """ self.logger = getLogger('processor.KrakenSegment') - assert_file_grp_cardinality(self.input_file_grp, 1) - assert_file_grp_cardinality(self.output_file_grp, 1) kwargs = {} kwargs['text_direction'] = self.parameter['text_direction'] self.use_legacy = self.parameter['use_legacy']