Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
模型结构转换代码来源项目 https://github.com/frotms/PaddleOCR2Pytorch?tab=readme-ov-file
1.将paddleOCRv4模型转换为pth模型,对齐结构和推理, 模型暂时放在modelscope, 暂只支持中英文的普通模型和server模型https://www.modelscope.cn/models/RapidAI/RapidOCR/files
2.进行benchmark精度测试,同参数下与onnx模型精度一致
engine = RapidOCR(det_use_cuda=True,rec_use_cuda=True,cls_use_cuda=True, det_box_thresh=0.6, det_unclip_ratio=1.5)
det: {'precision': 0.8628, 'recall': 0.8266, 'hmean': 0.8443, 'avg_elapse': 0.0907}
rec: 0.8
3.测试gpu推理耗时
[det,cls,rec]
gpu(4090):
[0.05285873200000424, 0.01902461051940918, 0.05982065200805664]
cpu(4 核 AMD EPYC 7453):
[0.2206176019999475, 0.03970503807067871, 0.3738100528717041]