Skip to content

Commit

Permalink
Merge pull request #49 from OCR-D/fix-48
Browse files Browse the repository at this point in the history
check for empty line image, ht @andbue, fix #48
  • Loading branch information
mikegerber authored Jan 20, 2021
2 parents e7fb432 + df53087 commit a014bab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ocrd_calamari/recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def process(self):
line_images_np = []
for (line_no, line) in enumerate(textlines):
line_image, line_coords = self.workspace.image_from_segment(line, region_image, region_xywh)
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)
raw_results_all = self.predictor.predict_raw(line_images_np, progress_bar=False)
Expand Down

0 comments on commit a014bab

Please sign in to comment.