From 30811fba3c35b6a49855b7a4722498e29b061e4c Mon Sep 17 00:00:00 2001 From: liuhongen1234567 <65936492+liuhongen1234567@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:21:41 +0800 Subject: [PATCH] Repair the bug in the inference script for LaTeX OCR (#13750) * test * dataprocess_abspath2relpath * repair bug in infer/predict_rec for latexocr --- tools/infer/predict_rec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/infer/predict_rec.py b/tools/infer/predict_rec.py index 239b09ef1..6306a760e 100755 --- a/tools/infer/predict_rec.py +++ b/tools/infer/predict_rec.py @@ -510,7 +510,7 @@ class TextRecognizer(object): shape = (1, 1, 3) mean = [0.7931, 0.7931, 0.7931] std = [0.1738, 0.1738, 0.1738] - scale = 255.0 + scale = np.float32(1.0 / 255.0) min_dimensions = [32, 32] max_dimensions = [672, 192] mean = np.array(mean).reshape(shape).astype("float32")