ocrd interface: add textline_light

pull/134/head
kba 4 months ago
parent 87adc4b0c6
commit 39b16e5978

@ -49,11 +49,16 @@
"default": false,
"description": "if this parameter set to true, this tool would check that input image need resizing and enhancement or not."
},
"light mode": {
"light_mode": {
"type": "boolean",
"default": false,
"description": "lighter and faster but simpler method for main region detection and deskewing"
},
"textline_light": {
"type": "boolean",
"default": false,
"description": "if this parameter set to true, this tool will try to return contoure of textlines instead of rectangle bounding box of textline with a faster method."
},
"headers_off": {
"type": "boolean",
"default": false,

@ -11,6 +11,10 @@ class EynollahProcessor(Processor):
def metadata_filename(self) -> str:
return 'eynollah/ocrd-tool.json'
def setup(self) -> None:
if self.parameter['textline_light'] and not self.parameter['light_mode']:
raise ValueError("Error: You set parameter 'textline_light' to enable light textline detection but parameter 'light_mode' is not enabled")
def process_page_pcgts(self, *input_pcgts: Optional[OcrdPage], page_id: Optional[str] = None) -> OcrdPageResult:
assert input_pcgts
assert input_pcgts[0]
@ -26,6 +30,7 @@ class EynollahProcessor(Processor):
allow_enhancement=self.parameter['allow_enhancement'],
curved_line=self.parameter['curved_line'],
light_version=self.parameter['light_mode'],
textline_light=self.parameter['textline_light'],
full_layout=self.parameter['full_layout'],
allow_scaling=self.parameter['allow_scaling'],
headers_off=self.parameter['headers_off'],

Loading…
Cancel
Save