A cross platform OCR Library based on OnnxRuntime.
Project description
rapidocr-onnxruntime Package
1. Install package by pypi.
$ pip install rapidocr-onnxruntime
2. Use.
-
Run by script.
import cv2 from rapidocr_onnxruntime import RapidOCR rapid_ocr = RapidOCR() img_path = 'tests/test_files/ch_en_num.jpg' # str result = rapid_ocr(img_path) # np.ndarray img = cv2.imread('tests/test_files/ch_en_num.jpg') result = rapid_ocr(img) # bytes with open(img_path, 'rb') as f: result = rapid_ocr(f.read()) # Path result = rapid_ocr(Path(img_path)) print(result) # result: [[dt_boxes], txt, score] # 示例:[[左上, 右上, 右下, 左下], '小明', '0.99'] # elapse_list: [det_elapse, cls_elapse, rec_elapse] # all_elapse = det_elapse + cls_elapse + rec_elapse
-
Run by command line.
$ rapidocr_onnxruntime -h usage: rapidocr_onnxruntime [-h] [-img IMG_PATH] [-p] optional arguments: -h, --help show this help message and exit -img IMG_PATH, --img_path IMG_PATH -p, --print_cost $ rapidocr_onnxruntime -img tests/test_files/ch_en_num.jpg
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
Close
Hashes for rapidocr_onnxruntime-1.1.28-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd10676cc898407bf817a3b7978f92c3e3a704415cbc499117dda837ffb95d1b |
|
MD5 | 922b0e5fbade3e99f5cd9e88be94fe97 |
|
BLAKE2b-256 | b83ffb9c97cf2acc2f1b3f3f5acb1d6dca90909d26c4b25553ed4c93b746d812 |