Update mdr_pdf_parser.py
Browse files- 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 *
|
| 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 |
|