利用 onnxruntime 及 PaddleOCR 提供的模型, 对图片中的文字进行检测与识别.
Project description
PPOCR-ONNX
简介
利用 onnxruntime 及 PaddleOCR 提供的模型, 对图片中的文字进行检测与识别.
使用模型
- 文字检测:
ch_PP-OCRv3_det_infer
- 方向分类:
cls mobile v2
- 文字识别:
ch_PP-OCRv2_rec_infer
参考
- PaddleOCR
- 手把手教你使用ONNXRunTime部署PP-OCR
ch_PP-OCRv3_det_infer
及ch_PP-OCRv2_rec_infer
模型来自 RapidAI/RapidOCR
安装
pip install ppocr-onnx
使用
from ppocronnx.predict_system import TextSystem
import cv2
text_sys = TextSystem()
# 识别单行文本
res = text_sys.ocr_single_line(cv2.imread('single_line_text.png'))
print(res)
# 批量识别单行文本
res = text_sys.ocr_lines([cv2.imread('single_line_text.png')])
print(res[0])
# 检测并识别文本
img = cv2.imread('test.png')
res = text_sys.detect_and_ocr(img)
for boxed_result in res:
print("{}, {:.3f}".format(boxed_result.ocr_text, boxed_result.score))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
v-ppocr-onnx-0.0.3.9.tar.gz
(12.3 MB
view hashes)
Built Distribution
Close
Hashes for v_ppocr_onnx-0.0.3.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e77272e8d3d6885aa58cb5766344237b2e13a749752635b85822eebedeb721ff |
|
MD5 | 92c412c6bc388d478a5f17f160a73dec |
|
BLAKE2b-256 | dd05aa20336b0d60ac415575096cc2bb718e659f2cff113b7083e52bce99a5ec |