Skip to content

Commit

Permalink
🐛 Fix word and glyph coordinates
Browse files Browse the repository at this point in the history
Fixes GH-57.
  • Loading branch information
mikegerber committed Feb 9, 2021
1 parent 41a4845 commit 0869386
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ocrd_calamari/recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit 0869386

Please sign in to comment.