Replies: 1 comment 3 replies
-
|
Hello, there are some differences in image preprocessing methods and evaluation between inference and PP-OCRv5. During inference, the scaling method used is 960 max (the optimal configuration for Chinese recognition and normally sized images), while during evaluation, it is 736 min. You can make the following changes to modify the preprocessing method during inference to match that of evaluation. An example code is provided below. from paddleocr import TextDetection
model = TextDetection(model_name="PP-OCRv5_server_det",limit_type="min",limit_side_len=736)
output = model.predict("general_ocr_001.png", batch_size=1)
for res in output:
res.print()
res.save_to_img(save_path="./output/")
res.save_to_json(save_path="./output/res.json") |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Training Environment:
PaddleOCR 3.2.0
PaddlePaddle-gpu 3.2.0
Python 3.10.12
Model Used:
PP-OCRv5_mobile_det_pretrained.pdparams
Issue:
I performed detection fine-tuning with my own dataset. Since I used the same dataset for training and inference, I expected high accuracy during inference.
However, during training, the best model achieved hmean = 0.9294 (92%), but when running inference after exported model, the accuracy is only about 0.8%, which is extremely low.
Dataset Characteristics:
The dataset contains very small images, ranging from 10×10 px to 50×50 px.
The label data is structured as follows. Since this is a digit recognition dataset, I stored the transcription in integer format:
train_det/img_02308.jpg [{"transcription": 50, "points": [[7, 7], [14, 7], [14, 14], [7, 14]]}]Config File:
I used the original PP-OCRv5_mobile_det config file and only modified paths and epoch number.
Inference Code:
To evaluate detection performance only, I used the TextDetection class:
Could you please let me know what might be causing such a huge gap between the training evaluation results and the inference results? Any guidance would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions