Skip to main content

A cross platform OCR Library based on OpenVINO.

Project description

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'
    
    # 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_openvino -h
      usage: rapidocr_openvino [-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_openvino -img tests/test_files/ch_en_num.jpg
    

Project details


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_openvino-1.1.29-py3-none-any.whl (12.3 MB 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