Replies: 5 comments 17 replies
|
onnxruntime-gpu在ocr任务上本来就很慢。参考文档:https://rapidai.github.io/RapidOCRDocs/main/blog/2022/09/24/onnxruntime-gpu%E6%8E%A8%E7%90%86/ |
7 replies
|
我直接用的官方的代码,只是数据是自己的,真的是慢,测试应该不会有错
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 日期 | 2025年06月23日 11:24 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [RapidAI/RapidOCR] v5的官方识别模型转成onnx推理很慢,显示gpu又再用的. (Discussion #444) |
你这里使用onnxruntime-gpu时,是啥配置呀。我和你配置为一样的,看看
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
1 reply
|
@dium6i 我这里重新测试了,ort gpu版依旧慢。方便的话,在你的机器上运行一下下面的代码,看看呢 GPU与CPU处理时间对比表
测试代码: from pathlib import Path
# rapidocr==3.2.0
from rapidocr import RapidOCR
# GPU
# pip install onnxruntime-gpu==1.18.0
engine = RapidOCR(params={"EngineConfig.onnxruntime.use_cuda": True})
# CPU
# pip install onnxruntime==1.22.0
# engine = RapidOCR()
elapses = []
img_list = list(Path("infer_imgs").iterdir())
for img_path in img_list:
result = engine(img_path)
print(f"{img_path.name}: {result.elapse:.2f}s")
elapses.append(result.elapse)
avg_elapse = sum(elapses) / len(elapses)
print(f"avg: {avg_elapse:.2f}s") |
1 reply
|
我测好多次变,一直怀疑是不是代码哪里问题,后来直接用仓库代码测试依旧是,就是慢
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 日期 | 2025年06月23日 20:47 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [RapidAI/RapidOCR] v5的官方识别模型转成onnx推理很慢,显示gpu又再用的. (Discussion #444) |
我这里重新测试了,ort gpu版依旧慢:
GPU与CPU处理时间对比表
| 文件名 | GPU处理时间(s) | CPU处理时间(s) |
| 01-1.jpg | 33.29 | 2.95 |
| 01-2.jpg | 24.72 | 1.40 |
| 02-1.jpg | 43.99 | 4.35 |
| 02-2.jpg | 50.09 | 8.96 |
| 1330001000080181003801_1.jpg | 16.19 | 2.76 |
| filter.png | 10.92 | 0.59 |
| general.png | 21.79 | 0.46 |
| henan_0000.jpg | 14.75 | 0.90 |
| henan_0001.jpg | 11.50 | 1.26 |
| henan_0002.jpg | 13.22 | 1.13 |
| henan_0003.jpg | 15.96 | 1.30 |
| Snipaste_2025-06-20_17-47-59.jpg | 5.60 | 1.09 |
| Snipaste_2025-06-23_09-09-59.jpg | 19.02 | 1.94 |
| avg | 21.62 | 2.24 |
测试代码:
frompathlibimportPath# rapidocr==3.2.0fromrapidocrimportRapidOCR# GPU# pip install onnxruntime-gpu==1.18.0engine=RapidOCR(params={"EngineConfig.onnxruntime.use_cuda": True})
# CPU# pip install onnxruntime# engine = RapidOCR()elapses= []
img_list=list(Path("infer_imgs").iterdir())
forimg_pathinimg_list:
result=engine(img_path)
print(f"{img_path.name}: {result.elapse:.2f}s")
elapses.append(result.elapse)
avg_elapse=sum(elapses) /len(elapses)
print(f"avg: {avg_elapse:.2f}")
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
0 replies
|
再安装一下cpu版本ort,再跑一下试试
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 发送日期 | 2025年06月24日 08:58 |
| 收件人 | RapidAI/RapidOCR ***@***.***> |
| 抄送人 | SWHL ***@***.***>,
Comment ***@***.***> |
| 主题 | Re: [RapidAI/RapidOCR] v5的官方识别模型转成onnx推理很慢,显示gpu又再用的. (Discussion #444) |
直接运行以上代码,结果如下:
Snipaste_2025-06-24_08-56-00.jpg (view on web)
我用的是Python 3.12、onnxruntime-gpu==1.22.0
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
8 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.
问题描述 / Problem Description
v5的官方识别模型转成onnx推理很慢,显示gpu又再用的.检测模型也很慢,检测模型也转成onnx ,跑通检测和识别这个流程很慢
运行环境 / Runtime Environment
onnxruntime-gpu 1.13.1 cuda 11.6
复现代码 / Reproduction Code
@DogeVenci @theikkila @benjaminwan
All reactions