Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suport torch inference #320

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Joker1212
Copy link
Member

@Joker1212 Joker1212 commented Jan 10, 2025

模型结构转换代码来源项目 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]

  1. make rapidOCR great again!

@SWHL SWHL added this to the v2.0.0 milestone Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants