rodrigomasini commited on
Commit
7038aec
·
verified ·
1 Parent(s): 4b079b3

Update mdr_pdf_parser.py

Browse files
Files changed (1) hide show
  1. mdr_pdf_parser.py +1 -1
mdr_pdf_parser.py CHANGED
@@ -1102,7 +1102,7 @@ class _MDR_TextRecognizer(_MDR_PredictBase):
1102
 
1103
  r_current = w_orig / float(h_orig)
1104
  # tw is target width, calculated to maintain aspect ratio up to imgW, using max of current ratio and batch max ratio
1105
- tw = min(imgW, int(ceil(imgH * max(r_current, max_r))))
1106
  tw = max(1, tw) # Ensure target width is at least 1
1107
  print(f" DEBUG RECOGNIZER: _resize_norm calculated target width (tw): {tw} for target height (imgH): {imgH}")
1108
 
 
1102
 
1103
  r_current = w_orig / float(h_orig)
1104
  # tw is target width, calculated to maintain aspect ratio up to imgW, using max of current ratio and batch max ratio
1105
+ tw = min(imgW, int(ceil(imgH * r_current)))
1106
  tw = max(1, tw) # Ensure target width is at least 1
1107
  print(f" DEBUG RECOGNIZER: _resize_norm calculated target width (tw): {tw} for target height (imgH): {imgH}")
1108