Skip to main content

RapidOCR

Project description

rapidocr-onnxruntime Package

1. Install package by pypi.

$ pip install rapidocr-onnxruntime

2. Download the models and config yaml.

$ wget https://github.com/RapidAI/RapidOCR/releases/download/v1.1.0/required_for_whl_v1.1.0.zip

# or by gitee
# wget https://gitee.com/RapidAI/RapidOCR/releases/download/v1.1.0/required_for_whl_v1.1.0.zip

$ unzip required_for_whl_v1.1.0.zip
$ cd required_for_whl_v1.1.0
  • The final directory of the folder:
    required_for_whl_v1.1.0/
    ├── config.yaml
    ├── README.md
    ├── test_demo.py
    ├── resources
    │   └── models
    │       ├── ch_ppocr_mobile_v2.0_cls_infer.onnx
    │       ├── ch_PP-OCRv3_det_infer.onnx
    │       └── ch_PP-OCRv3_rec_infer.onnx
    └── test_images
        └── ch_en_num.jpg
    

3. Use.

import cv2
from rapidocr_onnxruntime import RapidOCR

text_sys = RapidOCR('config.yaml')

img = cv2.imread('test_images/ch_en_num.jpg')

result = text_sys(img)
print(result)

# result: [[dt_boxes], txt, score]
# 示例:[[左上, 右上, 右下, 左下], '小明', '0.99']

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

rapidocr_onnxruntime-1.1.13-py3-none-any.whl (19.3 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