CoolFace
Modelpublic

marsena/paddleocr-test

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
Model Card

PaddleOCR ONNX Models

๐Ÿ”ฅ ONNX format models converted from PaddleOCR for easy deployment and testing

๐Ÿ“– Model Description

This repository contains ONNX format models converted from PaddleOCR, a practical ultra-lightweight OCR system. These models are optimized for production deployment and cross-platform compatibility.

๐Ÿ“ฆ Model Files

File NameSizeDescription
PP-OCRv5_server_det_infer.onnx84MBText detection model - locates text regions in images
PP-OCRv5_server_rec_infer.onnx81MBText recognition model - recognizes text content
UVDoc_infer.onnx30MBDocument rectification model - corrects document perspective
PP-LCNet_x1_0_doc_ori_infer.onnx6.5MBDocument orientation detection
PP-LCNet_x1_0_textline_ori_infer.onnx6.5MBText line orientation detection
PP-OCRv5_server_rec_infer.yml145KBRecognition model configuration file

Total Size: ~208MB

๐Ÿš€ Quick Start

Installation

bash
pip install huggingface_hub onnxruntime

Download Models

python
from huggingface_hub import hf_hub_download
import os

def download_paddleocr_models():
    """Download all PaddleOCR ONNX models"""
    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"Downloading {file}...")
        hf_hub_download(
            repo_id="marsena/paddleocr-test",
            filename=file,
            local_dir=cache_dir
        )
    print("All models downloaded!")

# Download models
download_paddleocr_models()

Basic Usage

python
import onnxruntime as ort
import numpy as np
from PIL import Image

# Load detection model
det_session = ort.InferenceSession("models/PP-OCRv5_server_det_infer.onnx")

# Load recognition model  
rec_session = ort.InferenceSession("models/PP-OCRv5_server_rec_infer.onnx")

# Your OCR pipeline implementation here...

๐Ÿท๏ธ Model Tags

  • โ€”Framework: ONNX
  • โ€”Task: Computer Vision, OCR
  • โ€”Language: Multi-language support
  • โ€”Domain: Text Detection, Text Recognition

๐Ÿ”ง Technical Details

Conversion Process

These models were converted from PaddlePaddle format to ONNX format for broader compatibility:

  1. 1.Source: Original PaddleOCR models from PaddlePaddle Hub
  2. 2.Conversion: PaddlePaddle โ†’ ONNX format
  3. 3.Optimization: Model optimization for inference speed
  4. 4.Validation: Output consistency verification

System Requirements

  • โ€”Runtime: ONNX Runtime
  • โ€”Python: 3.7+
  • โ€”Memory: Minimum 2GB RAM recommended
  • โ€”Platform: Cross-platform (Windows, Linux, macOS)

๐Ÿ“„ License

This project follows the Apache 2.0 License, consistent with the original PaddleOCR project.

Original PaddleOCR License

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.

๐Ÿ™ Acknowledgments

  • โ€”Original Project: PaddleOCR by PaddlePaddle Team
  • โ€”Framework: PaddlePaddle
  • โ€”Conversion Tools: ONNX ecosystem

๐Ÿ“š 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},
    year={2020},
    howpublished={\url{https://github.com/PaddlePaddle/PaddleOCR}}
}

โ“ Issues & Support

For issues related to:


Note: This is a community contribution for easier deployment of PaddleOCR models. For production use, please ensure compliance with your specific requirements and test thoroughly.