Skip to main content

rapidocr-openvino Package

1. Install package by pypi.

$ pip install rapidocr-openvino

2. Use.

  • Run by script.

    import cv2
    from rapidocr_openvino import RapidOCR
    
    rapid_ocr = RapidOCR()
    
    img_path = 'tests/test_files/ch_en_num.jpg'
    
    # Support:Union[str, np.ndarray, bytes, Path]
    # str
    result, elapse = rapid_ocr(img_path)
    
    # np.ndarray
    img = cv2.imread('tests/test_files/ch_en_num.jpg')
    result, elapse = rapid_ocr(img)
    
    # bytes
    with open(img_path, 'rb') as f:
        result, elapse = rapid_ocr(f.read())
    
    # Path
    result, elapse = rapid_ocr(Path(img_path))
    print(result)
    
    # result: [[dt_boxes], txt, score]
    # e.g.:[[left-top, right-top, right-down, left-top], '小明', '0.99']
    
    # elapse: [det_elapse, cls_elapse, rec_elapse]
    # all_elapse = det_elapse + cls_elapse + rec_elapse
    
    # If without valid texts, result: (None, None )
    
  • Run by command line.

    $ rapidocr_openvino -h
    usage: rapidocr_openvino [-h] -img IMG_PATH [-p] [--text_score TEXT_SCORE]
                            [--use_angle_cls USE_ANGLE_CLS]
                            [--use_text_det USE_TEXT_DET]
                            [--print_verbose PRINT_VERBOSE]
                            [--min_height MIN_HEIGHT]
                            [--width_height_ratio WIDTH_HEIGHT_RATIO]
                            [--det_model_path DET_MODEL_PATH]
                            [--det_limit_side_len DET_LIMIT_SIDE_LEN]
                            [--det_limit_type {max,min}]
                            [--det_thresh DET_THRESH]
                            [--det_box_thresh DET_BOX_THRESH]
                            [--det_unclip_ratio DET_UNCLIP_RATIO]
                            [--det_use_dilation DET_USE_DILATION]
                            [--det_score_mode {slow,fast}]
                            [--cls_model_path CLS_MODEL_PATH]
                            [--cls_image_shape CLS_IMAGE_SHAPE]
                            [--cls_label_list CLS_LABEL_LIST]
                            [--cls_batch_num CLS_BATCH_NUM]
                            [--cls_thresh CLS_THRESH]
                            [--rec_model_path REC_MODEL_PATH]
                            [--rec_image_shape REC_IMAGE_SHAPE]
                            [--rec_batch_num REC_BATCH_NUM]
    
    optional arguments:
    -h, --help            show this help message and exit
    -img IMG_PATH, --img_path IMG_PATH
    -p, --print_cost
    
    Global:
    --text_score TEXT_SCORE
    --use_angle_cls USE_ANGLE_CLS
    --use_text_det USE_TEXT_DET
    --print_verbose PRINT_VERBOSE
    --min_height MIN_HEIGHT
    --width_height_ratio WIDTH_HEIGHT_RATIO
    
    Det:
    --det_model_path DET_MODEL_PATH
    --det_limit_side_len DET_LIMIT_SIDE_LEN
    --det_limit_type {max,min}
    --det_thresh DET_THRESH
    --det_box_thresh DET_BOX_THRESH
    --det_unclip_ratio DET_UNCLIP_RATIO
    --det_use_dilation DET_USE_DILATION
    --det_score_mode {slow,fast}
    
    Cls:
    --cls_model_path CLS_MODEL_PATH
    --cls_image_shape CLS_IMAGE_SHAPE
    --cls_label_list CLS_LABEL_LIST
    --cls_batch_num CLS_BATCH_NUM
    --cls_thresh CLS_THRESH
    
    Rec:
    --rec_model_path REC_MODEL_PATH
    --rec_image_shape REC_IMAGE_SHAPE
    --rec_batch_num REC_BATCH_NUM
    
    $ rapidocr_openvino -img tests/test_files/ch_en_num.jpg
    

Metadata

Release files for rapidocr-openvino 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for rapidocr-openvino 1.2.3
File Interpreter ABI Platform Actions
rapidocr_openvino-1.2.3-py3-none-any.whl Python 3 none any Details for rapidocr_openvino-1.2.3-py3-none-any.whl

Release files / rapidocr_openvino-1.2.3-py3-none-any.whl

Download URL rapidocr_openvino-1.2.3-py3-none-any.whl
Size 12.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4724299530f86dd8a6174e2e15fab678240283b1e60a5f67ce320ce626b1ba4f
BLAKE2b-256 checksum
How to use checksums
f8dab9b6bd91c85e14f77ea3e291b345a6e0c02a294e98a1106869cca8f12d51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for rapidocr-openvino 1.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page