利用 onnxruntime 及 PaddleOCR 提供的模型, 对图片中的文字进行检测与识别.
Project description
PPOCR-ONNX
简介
利用 onnxruntime 及 PaddleOCR 提供的模型, 对图片中的文字进行检测与识别.
使用模型
- 文字检测:
ch_PP-OCRv2_det_infer
- 方向分类:
cls mobile v2
- 文字识别:
ch_PP-OCRv2_rec_infer
参考
- PaddleOCR
- 手把手教你使用ONNXRunTime部署PP-OCR
ch_PP-OCRv2_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ppocr-onnx-0.0.3.5.tar.gz
(10.4 MB
view details)
Built Distribution
File details
Details for the file ppocr-onnx-0.0.3.5.tar.gz
.
File metadata
- Download URL: ppocr-onnx-0.0.3.5.tar.gz
- Upload date:
- Size: 10.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7a74509ccde479e1f8cdce01a06d2cc60e1fe0de51dab3cd0e299c3833f9b53 |
|
MD5 | c1184b8dba0b89f8bbf82c2d13b1c518 |
|
BLAKE2b-256 | 5d86ef153e1e19fdaba5cb2a9a4b111a42c1293565ee18547cf69314a611abda |
File details
Details for the file ppocr_onnx-0.0.3.5-py3-none-any.whl
.
File metadata
- Download URL: ppocr_onnx-0.0.3.5-py3-none-any.whl
- Upload date:
- Size: 10.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94bee9bee1093d7f9175fa5ae7be881bd731fbbd07232b0f5014208f4ab90318 |
|
MD5 | 75b428696955cb4f3e484cf2f7203963 |
|
BLAKE2b-256 | c45797ebccc1739c1af3649d3a63d7a0df12adc50e5876b3eacb9166fb1e96b3 |