File size: 5,033 Bytes
266e861 06c3603 266e861 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
---
license: apache-2.0
tags:
- onnx
- paddleocr
- ocr
- computer-vision
- text-recognition
- text-detection
library_name: onnxruntime
pipeline_tag: image-to-text
base_model:
- PaddlePaddle/PP-OCRv5_server_det
- PaddlePaddle/PP-OCRv5_server_rec
---
# PaddleOCR ONNX Models
PaddleOCR PP-OCRv5 models converted to ONNX format for efficient OCR inference.
[English](#english) | [中文說明](#中文說明)
## 中文說明
這是 PaddleOCR PP-OCRv5 模型的 ONNX 格式版本,用於高效率的文字辨識推理。
### 模型檔案說明
| 檔案名稱 | 說明 |
|---------|------|
| `PP-OCRv5_server_det_infer.onnx` | 文字檢測模型 - 偵測圖片中文字的位置 |
| `PP-OCRv5_server_rec_infer.onnx` | 文字辨識模型 - 辨識文字內容 |
| `PP-LCNet_x1_0_textline_ori_infer.onnx` | 文字方向分類模型 |
| `PP-LCNet_x1_0_doc_ori_infer.onnx` | 文件方向修正模型 |
| `UVDoc_infer.onnx` | 文件展平模型 |
| `PP-OCRv5_server_rec_infer.yml` | 字符字典配置檔 |
### 快速使用
```python
from huggingface_hub import hf_hub_download
# 下載文字檢測模型
det_model_path = hf_hub_download(
repo_id="marsena/paddleocr-onnx-models",
filename="PP-OCRv5_server_det_infer.onnx"
)
# 下載文字辨識模型
rec_model_path = hf_hub_download(
repo_id="marsena/paddleocr-onnx-models",
filename="PP-OCRv5_server_rec_infer.onnx"
)
```
### 一次下載所有模型
```python
from huggingface_hub import snapshot_download
# 下載所有模型檔案到本地資料夾
snapshot_download(
repo_id="marsena/paddleocr-onnx-models",
local_dir="./paddleocr_onnx"
)
```
### 支援的語言和文字類型
- **語言支援**: 簡體中文、繁體中文、英文、日文
- **文字類型**: 印刷體、手寫體、直書文字、旋轉文字、彎曲文字
- **輸入格式**: 圖片檔案 (JPEG, PNG)
- **運行環境**: 支援 CPU 和 GPU 推理
---
## English
## Model Files
| File | Description |
|------|-------------|
| `PP-OCRv5_server_det_infer.onnx` | Text detection model |
| `PP-OCRv5_server_rec_infer.onnx` | Text recognition model |
| `PP-LCNet_x1_0_textline_ori_infer.onnx` | Text orientation classification |
| `PP-LCNet_x1_0_doc_ori_infer.onnx` | Document orientation correction |
| `UVDoc_infer.onnx` | Document unwarping |
| `PP-OCRv5_server_rec_infer.yml` | Character dictionary config |
## Source Models
These ONNX models are converted from official PaddlePaddle PP-OCRv5 models:
- **Detection Model**: [PaddlePaddle/PP-OCRv5_server_det](https://huggingface.co/PaddlePaddle/PP-OCRv5_server_det)
- **Recognition Model**: [PaddlePaddle/PP-OCRv5_server_rec](https://huggingface.co/PaddlePaddle/PP-OCRv5_server_rec)
- **Official Documentation**: [PP-OCRv5 Introduction](https://paddlepaddle.github.io/PaddleOCR/main/en/version3.x/algorithm/PP-OCRv5/PP-OCRv5.html)
## Usage
### Download Specific Model
```python
from huggingface_hub import hf_hub_download
# Download detection model
det_model_path = hf_hub_download(
repo_id="marsena/paddleocr-onnx-models",
filename="PP-OCRv5_server_det_infer.onnx"
)
# Download recognition model
rec_model_path = hf_hub_download(
repo_id="marsena/paddleocr-onnx-models",
filename="PP-OCRv5_server_rec_infer.onnx"
)
```
### Download All Models
```python
from huggingface_hub import snapshot_download
# Download all model files to local directory
snapshot_download(
repo_id="marsena/paddleocr-onnx-models",
local_dir="./paddleocr_onnx"
)
```
### ONNX Runtime Inference
```python
import onnxruntime as ort
import numpy as np
# Load model
session = ort.InferenceSession("PP-OCRv5_server_det_infer.onnx")
# Run inference
input_name = session.get_inputs()[0].name
output = session.run(None, {input_name: input_data})
```
## Model Specifications
- **Languages**: Simplified Chinese, Traditional Chinese, English, Japanese
- **Text Types**: Printed text, handwriting, vertical text, rotated text
- **Input Format**: Images (JPEG, PNG)
- **Output Format**: Bounding boxes + recognized text
- **Runtime**: ONNX Runtime 1.16+
- **Hardware**: CPU and GPU inference supported
## License
These models follow the **Apache License 2.0**, consistent with the original PaddleOCR project.
- **PaddleOCR Repository**: https://github.com/PaddlePaddle/PaddleOCR
- **License Details**: [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
## Conversion Information
- **Conversion Tool**: Paddle2ONNX
- **ONNX Version**: 1.12+
- **Source Framework**: PaddlePaddle 2.5+
- **Conversion Date**: January 2025
## Citation
If you use these models in your research, please cite the original PaddleOCR paper:
```bibtex
@misc{paddleocr2020,
title={PaddleOCR: Awesome multilingual OCR toolkits},
author={PaddlePaddle Authors},
howpublished = {\url{https://github.com/PaddlePaddle/PaddleOCR}},
year={2020}
}
```
## Issues
For model usage issues, please report to the original PaddleOCR repository:
- **PaddleOCR Issues**: https://github.com/PaddlePaddle/PaddleOCR/issues |