Downloads · 30 days
0
ilaylow/PP_OCRv5_mobile_onnx
PP_OCRv5_mobile_onnx is a machine learning model from ilaylow. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Model Source (Rec): https://huggingface.co/PaddlePaddle/PP-OCRv5mobilerec
Downloads · 30 days
0
Access
Public
Updated Mar 19, 2026
Repo size
21.4 MB
Likes
1
Public
Click a slice to open those files.
.onnx21.4 MB · 100%
From the Hugging Face model README
Model Source (Rec): https://huggingface.co/PaddlePaddle/PP-OCRv5_mobile_rec
Model Source (Det): https://huggingface.co/PaddlePaddle/PP-OCRv5_mobile_det
Converted using paddle2onnx:
Example Usage:
from rapidocr_onnxruntime import RapidOCR
from huggingface_hub import hf_hub_download
import cv2
def draw_boxes_cv(image_path, ocr_result, out_path="boxed_cv.png"):
img = cv2.imread(image_path)
for line in ocr_result:
box = line[0]
xs = [p[0] for p in box]
ys = [p[1] for p in box]
pt1 = (int(min(xs)), int(min(ys)))
pt2 = (int(max(xs)), int(max(ys)))
cv2.rectangle(img, pt1, pt2, (0, 0, 255), 2)
cv2.imwrite(out_path, img)
# Model paths
det_path = "<path_to_model>/ppocrv5_det.onnx"
rec_path = "<path_to_model>/ppocrv5_rec.onnx"
dict_path = "<path_to_dictionary>" # E.g. hf_hub_download("monkt/paddleocr-onnx", "languages/chinese/dict.txt")
# Initialize OCR model
ocr = RapidOCR(
det_model_path=det_path,
rec_model_path=rec_path,
rec_keys_path=dict_path
)
result, elapsed = ocr("document.png")
for res in result:
print(f"Word: {res[1]} with Probability: {res[2]}")
draw_boxes_cv("document.png", result)