1
0
Fork 0
mirror of https://github.com/qurator-spk/dinglehopper.git synced 2025-06-09 03:40:12 +02:00

dinglehopper: Support disabling metrics in the OCR-D interface

This commit is contained in:
Gerber, Mike 2020-06-09 18:29:59 +02:00
parent f699697eb3
commit 668de758a0
3 changed files with 22 additions and 2 deletions

View file

@ -16,7 +16,14 @@
],
"steps": [
"recognition/text-recognition"
]
],
"parameters": {
"metrics": {
"type": "boolean",
"default": true,
"description": "Enable/disable metrics and green/red"
}
}
}
}
}

View file

@ -34,6 +34,7 @@ class OcrdDinglehopperEvaluate(Processor):
return file_id
def process(self):
metrics = self.parameter['metrics']
gt_grp, ocr_grp = self.input_file_grp.split(',')
for n, page_id in enumerate(self.workspace.mets.physical_pages):
gt_file = self.workspace.mets.find_files(fileGrp=gt_grp, pageId=page_id)[0]
@ -50,7 +51,12 @@ class OcrdDinglehopperEvaluate(Processor):
os.mkdir(self.output_file_grp)
except FileExistsError:
pass
cli_process(gt_file.local_filename, ocr_file.local_filename, report_prefix)
cli_process(
gt_file.local_filename,
ocr_file.local_filename,
report_prefix,
metrics=metrics
)
# Add reports to the workspace
for report_suffix, mimetype in \