Skip to content

Commit

Permalink
Merge pull request #347 from mijoo308/master
Browse files Browse the repository at this point in the history
fix ZeroDivision Error for blank images #346
  • Loading branch information
rkcosmos authored Jan 14, 2021
2 parents 0b67787 + d749ac0 commit 8fca29a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions easyocr/easyocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def recognize(self, img_cv_grey, horizontal_list=None, free_list=None,\
ignore_char = ''.join(set(self.character)-set(self.lang_char))

image_len = len(image_list)
if rotation_info:
if rotation_info and image_list:
image_list = make_rotated_img_list(rotation_info, image_list)

if self.model_lang in ['chinese_tra','chinese_sim', 'japanese', 'korean']: decoder = 'greedy'
Expand All @@ -336,7 +336,7 @@ def recognize(self, img_cv_grey, horizontal_list=None, free_list=None,\
if paragraph:
result = get_paragraph(result, mode = direction_mode)

if rotation_info:
if rotation_info and image_list:
result = set_result_with_confidence(result, image_len)

if detail == 0:
Expand Down

0 comments on commit 8fca29a

Please sign in to comment.