diff --git a/ocrd_calamari/recognize.py b/ocrd_calamari/recognize.py index 817d6d5..43b8930 100644 --- a/ocrd_calamari/recognize.py +++ b/ocrd_calamari/recognize.py @@ -87,6 +87,7 @@ def process(self): textlines = region.get_TextLine() log.info("About to recognize %i lines of region '%s'", len(textlines), region.id) line_images_np = [] + line_coordss = [] for line in textlines: log.debug("Recognizing line '%s' in region '%s'", line.id, region.id) @@ -101,9 +102,10 @@ def process(self): line_image = line_image if all(line_image.size) else [[0]] line_image_np = np.array(line_image, dtype=np.uint8) line_images_np.append(line_image_np) + line_coordss.append(line_coords) raw_results_all = self.predictor.predict_raw(line_images_np, progress_bar=False) - for line, raw_results in zip(textlines, raw_results_all): + for line, line_coords, raw_results in zip(textlines, line_coordss, raw_results_all): for i, p in enumerate(raw_results): p.prediction.id = "fold_{}".format(i)