Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions easyocr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ def calculate_ratio(width,height):
ratio = width/height
if ratio<1.0:
ratio = 1./ratio
#set to 2 decimal places, to avoid OverflowError(cannot convert float infinity to integer) while other methods covert this ratio to int
ratio = round(ratio,3)
return ratio

def compute_ratio_and_resize(img,width,height,model_height):
Expand Down