From 87adc4b0c69233f15a637be5841477ad6f905ece Mon Sep 17 00:00:00 2001 From: kba Date: Sat, 24 Aug 2024 16:51:52 +0200 Subject: [PATCH] ocrd interface: add light_mode parameter --- qurator/eynollah/ocrd-tool.json | 5 +++++ qurator/eynollah/processor.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/qurator/eynollah/ocrd-tool.json b/qurator/eynollah/ocrd-tool.json index 311ac21..28dd772 100644 --- a/qurator/eynollah/ocrd-tool.json +++ b/qurator/eynollah/ocrd-tool.json @@ -49,6 +49,11 @@ "default": false, "description": "if this parameter set to true, this tool would check that input image need resizing and enhancement or not." }, + "light mode": { + "type": "boolean", + "default": false, + "description": "lighter and faster but simpler method for main region detection and deskewing" + }, "headers_off": { "type": "boolean", "default": false, diff --git a/qurator/eynollah/processor.py b/qurator/eynollah/processor.py index 83fed0e..65122dd 100644 --- a/qurator/eynollah/processor.py +++ b/qurator/eynollah/processor.py @@ -14,6 +14,7 @@ class EynollahProcessor(Processor): def process_page_pcgts(self, *input_pcgts: Optional[OcrdPage], page_id: Optional[str] = None) -> OcrdPageResult: assert input_pcgts assert input_pcgts[0] + assert self.parameter pcgts = input_pcgts[0] page = pcgts.get_Page() # XXX loses DPI information @@ -24,6 +25,7 @@ class EynollahProcessor(Processor): self.logger, allow_enhancement=self.parameter['allow_enhancement'], curved_line=self.parameter['curved_line'], + light_version=self.parameter['light_mode'], full_layout=self.parameter['full_layout'], allow_scaling=self.parameter['allow_scaling'], headers_off=self.parameter['headers_off'],