Views
No views yet
| File Name | Size | Description |
|---|---|---|
PP-OCRv5_server_det_infer.onnx | 84MB | Text detection model - locates text regions in images |
PP-OCRv5_server_rec_infer.onnx | 81MB | Text recognition model - recognizes text content |
UVDoc_infer.onnx | 30MB | Document rectification model - corrects document perspective |
PP-LCNet_x1_0_doc_ori_infer.onnx | 6.5MB | Document orientation detection |
PP-LCNet_x1_0_textline_ori_infer.onnx | 6.5MB | Text line orientation detection |
PP-OCRv5_server_rec_infer.yml | 145KB | Recognition model configuration file |
pip install huggingface_hub onnxruntime1from huggingface_hub import hf_hub_download
2import os
3
4def download_paddleocr_models():
5 """Download all PaddleOCR ONNX models"""
6 model_files = [
7 "PP-OCRv5_server_det_infer.onnx",
8 "PP-OCRv5_server_rec_infer.onnx",
9 "UVDoc_infer.onnx",
10 "PP-LCNet_x1_0_doc_ori_infer.onnx",
11 "PP-LCNet_x1_0_textline_ori_infer.onnx",
12 "PP-OCRv5_server_rec_infer.yml"
13 ]
14
15 cache_dir = "models"
16 os.makedirs(cache_dir, exist_ok=True)
17
18 for file in model_files:
19 print(f"Downloading {file}...")
20 hf_hub_download(
21 repo_id="marsena/paddleocr-test",
22 filename=file,
23 local_dir=cache_dir
24 )
25 print("All models downloaded!")
26
27# Download models
28download_paddleocr_models()1import onnxruntime as ort
2import numpy as np
3from PIL import Image
4
5# Load detection model
6det_session = ort.InferenceSession("models/PP-OCRv5_server_det_infer.onnx")
7
8# Load recognition model
9rec_session = ort.InferenceSession("models/PP-OCRv5_server_rec_infer.onnx")
10
11# Your OCR pipeline implementation here...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.1@misc{paddleocr2020,
2 title={PaddleOCR: Awesome multilingual OCR toolkits},
3 author={PaddlePaddle Authors},
4 year={2020},
5 howpublished={\url{https://github.com/PaddlePaddle/PaddleOCR}}
6}