🐛 Fix OCR-D CLI for newest OCR-D

Now that find_files() is a generator, we can't use [0] to get the file.
pull/38/head
Gerber, Mike 4 years ago
parent 5ed184c8c4
commit f2367ac0c3

@ -34,8 +34,8 @@ class OcrdDinglehopperEvaluate(Processor):
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]
ocr_file = self.workspace.mets.find_files(fileGrp=ocr_grp, pageId=page_id)[0]
gt_file = next(self.workspace.mets.find_files(fileGrp=gt_grp, pageId=page_id))
ocr_file = next(self.workspace.mets.find_files(fileGrp=ocr_grp, pageId=page_id))
gt_file = self.workspace.download_file(gt_file)
ocr_file = self.workspace.download_file(ocr_file)
log.info("INPUT FILES %i / %s%s", n, gt_file, ocr_file)

@ -5,7 +5,7 @@ uniseg
numpy
colorama
MarkupSafe
ocrd >= 2.13.1
ocrd >= 2.18.0
attrs
multimethod == 1.3 # latest version to officially support Python 3.5
tqdm
Loading…
Cancel
Save