Skip to content

Commit

Permalink
check for empty line image, ht @andbue, fix #48
Browse files Browse the repository at this point in the history
  • Loading branch information
kba committed Dec 17, 2020
1 parent 1c7fcda commit df53087
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 @@ -74,6 +74,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 df53087

Please sign in to comment.