Skip to main content

利用 onnxruntime 及 PaddleOCR 提供的模型, 对图片中的文字进行检测与识别.

Project description

PPOCR-ONNX

简介

利用 onnxruntime 及 PaddleOCR 提供的模型, 对图片中的文字进行检测与识别.

使用模型

  • 文字检测: ch_PP-OCRv2_det_infer
  • 方向分类: cls mobile v2
  • 文字识别: rec mobile v2

安装

pip install ppocr-onnx

使用

识别分行的文本(每行一张图片, RGB 格式)

from ppocronnx import TextSystem
import cv2

ts = TextSystem()
img = cv2.imread('test.png')
print(ts.ocr_lines([img]))

文本检测及识别

from ppocronnx import TextSystem
import cv2

ts = TextSystem()
img = cv2.imread('test.png')
print(ts.detect_and_ocr(img))

参考

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

ppocr-onnx-0.0.3.2.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

ppocr_onnx-0.0.3.2-py3-none-any.whl (23.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page