返回模型
说明文档
PaddleOCR ONNX 模型
🔥 从 PaddleOCR 转换的 ONNX 格式模型,便于部署和测试
📖 模型描述
本仓库包含从 PaddleOCR 转换的 ONNX 格式模型,这是一个实用的超轻量级 OCR 系统。这些模型针对生产部署和跨平台兼容性进行了优化。
📦 模型文件
| 文件名 | 大小 | 描述 |
|---|---|---|
PP-OCRv5_server_det_infer.onnx |
84MB | 文本检测模型 - 定位图像中的文本区域 |
PP-OCRv5_server_rec_infer.onnx |
81MB | 文本识别模型 - 识别文本内容 |
UVDoc_infer.onnx |
30MB | 文档矫正模型 - 修正文档透视 |
PP-LCNet_x1_0_doc_ori_infer.onnx |
6.5MB | 文档方向检测 |
PP-LCNet_x1_0_textline_ori_infer.onnx |
6.5MB | 文本行方向检测 |
PP-OCRv5_server_rec_infer.yml |
145KB | 识别模型配置文件 |
总大小: ~208MB
🚀 快速开始
安装
pip install huggingface_hub onnxruntime
下载模型
from huggingface_hub import hf_hub_download
import os
def download_paddleocr_models():
\"\"\"下载所有 PaddleOCR ONNX 模型\"\"\"
model_files = [
\"PP-OCRv5_server_det_infer.onnx\",
\"PP-OCRv5_server_rec_infer.onnx\",
\"UVDoc_infer.onnx\",
\"PP-LCNet_x1_0_doc_ori_infer.onnx\",
\"PP-LCNet_x1_0_textline_ori_infer.onnx\",
\"PP-OCRv5_server_rec_infer.yml\"
]
cache_dir = \"models\"
os.makedirs(cache_dir, exist_ok=True)
for file in model_files:
print(f\"正在下载 {file}...\")
hf_hub_download(
repo_id=\"marsena/paddleocr-test\",
filename=file,
local_dir=cache_dir
)
print(\"所有模型已下载完成!\")
# 下载模型
download_paddleocr_models()
基本使用
import onnxruntime as ort
import numpy as np
from PIL import Image
# 加载检测模型
det_session = ort.InferenceSession(\"models/PP-OCRv5_server_det_infer.onnx\")
# 加载识别模型
rec_session = ort.InferenceSession(\"models/PP-OCRv5_server_rec_infer.onnx\")
# 在此处实现您的 OCR 流水线...
🏷️ 模型标签
- 框架: ONNX
- 任务: 计算机视觉、OCR
- 语言: 多语言支持
- 领域: 文本检测、文本识别
🔧 技术细节
转换过程
这些模型从 PaddlePaddle 格式转换为 ONNX 格式,以实现更广泛的兼容性:
- 来源: 来自 PaddlePaddle Hub 的原始 PaddleOCR 模型
- 转换: PaddlePaddle → ONNX 格式
- 优化: 针对推理速度进行模型优化
- 验证: 输出一致性验证
系统要求
- 运行时: ONNX Runtime
- Python: 3.7+
- 内存: 建议至少 2GB RAM
- 平台: 跨平台(Windows、Linux、macOS)
📄 许可证
本项目遵循 Apache 2.0 许可证,与原始 PaddleOCR 项目保持一致。
原始 PaddleOCR 许可证
Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the \"License\");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an \"AS IS\" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
🙏 致谢
- 原始项目: PaddlePaddle 团队的 PaddleOCR
- 框架: PaddlePaddle
- 转换工具: ONNX 生态系统
📚 引用
如果您在研究中使用这些模型,请引用原始 PaddleOCR 论文:
@misc{paddleocr2020,
title={PaddleOCR: Awesome multilingual OCR toolkits},
author={PaddlePaddle Authors},
year={2020},
howpublished={\url{https://github.com/PaddlePaddle/PaddleOCR}}
}
❓ 问题与支持
关于以下方面的问题:
- 模型转换: 在本仓库创建 issue
- 原始 PaddleOCR: 访问 PaddleOCR Issues
- ONNX Runtime: 访问 ONNX Runtime Issues
注意: 这是一个社区贡献,旨在更轻松地部署 PaddleOCR 模型。用于生产环境时,请确保符合您的特定要求并进行充分测试。
marsena/paddleocr-test
作者 marsena
image-to-text
onnx
↓ 0
♥ 0
创建时间: 2025-09-05 09:10:00+00:00
更新时间: 2025-09-05 09:26:04+00:00
在 Hugging Face 上查看文件 (8)
.gitattributes
PP-LCNet_x1_0_doc_ori_infer.onnx
ONNX
PP-LCNet_x1_0_textline_ori_infer.onnx
ONNX
PP-OCRv5_server_det_infer.onnx
ONNX
PP-OCRv5_server_rec_infer.onnx
ONNX
PP-OCRv5_server_rec_infer.yml
README.md
UVDoc_infer.onnx
ONNX