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

Merged
merged 2 commits into from
Feb 8, 2025
Merged

suport torch inference #320

merged 2 commits into from
Feb 8, 2025

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
@SWHL
Copy link
Member

SWHL commented Jan 17, 2025

这个PR会作为2.0.0版本的feature,需要耐心等待一下哈。

@skeeker
Copy link

skeeker commented Jan 21, 2025

make rapidOCR great again!

@SWHL SWHL mentioned this pull request Jan 22, 2025
9 tasks
@SWHL SWHL merged commit 42e4d9d into RapidAI:main Feb 8, 2025
SWHL pushed a commit that referenced this pull request Feb 8, 2025
* feat: add rapidocr_torch inference

* ci: fix push workflow
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.

3 participants