Skip to main content

A cross platform OCR Library based on OnnxRuntime.

Project description

rapidocr-web

PyPI

Web use

  1. Install package by pypi.
    $ pip install rapidocr-web
    
  2. Run by command line.
    • Usage:
      $ rapidocr_web -h
      usage: rapidocr_web [-h] [-ip IP] [-p PORT]
      
      optional arguments:
      -h, --help            show this help message and exit
      -ip IP, --ip IP       IP Address
      -p PORT, --port PORT  IP port
      
    • Example:
      $ rapidocr_web -ip "0.0.0.0" -p 9003
      
  3. Open http://localhost:9003/ to view, enjoy it.

API Use

  1. Installrapidocr_web[api]

    $ pip install rapidocr_web[api]
    
  2. Run

    • Usage:
      $ rapidocr_api -h
      usage: rapidocr_api [-h] [-ip IP] [-p PORT]
      
      optional arguments:
      -h, --help            show this help message and exit
      -ip IP, --ip IP       IP Address
      -p PORT, --port PORT  IP port
      
    • Example:
      $ rapidocr_api -ip 0.0.0.0 -p 9003
      
  3. Use

    import requests
    
    url = 'http://localhost:9003/ocr'
    img_path = '../python/tests/test_files/ch_en_num.jpg'
    
    with open(img_path, 'rb') as f:
        file_dict = {'image': (img_path, f, 'image/png')}
        response = requests.post(url, files=file_dict, timeout=60)
    
    res_rec = response.json()
    print(res_rec)
    
  4. Output

    Click to expand
    {
        "0": {
            "rec_txt": "香港深圳抽血,",
            "dt_boxes": [
                [265, 18],
                [472, 231],
                [431, 271],
                [223, 59]
            ],
            "score": "0.8175641223788261"
        },
        "1": {
            "rec_txt": "专业查性别",
            "dt_boxes": [
                [388, 15],
                [636, 257],
                [587, 307],
                [339, 65]
            ],
            "score": "0.8293875356515249"
        },
        "2": {
            "rec_txt": "专业鉴定B超单",
            "dt_boxes": [
                [215, 84],
                [509, 413],
                [453, 463],
                [159, 134]
            ],
            "score": "0.8626169338822365"
        },
        "3": {
            "rec_txt": "b超仪器查性别",
            "dt_boxes": [
                [128, 135],
                [430, 478],
                [366, 534],
                [64, 192]
            ],
            "score": "0.8449362441897392"
        },
        "4": {
            "rec_txt": "加微信eee",
            "dt_boxes": [
                [58, 189],
                [268, 450],
                [209, 498],
                [0, 236]
            ],
            "score": "0.8176911813872201"
        },
        "5": {
            "rec_txt": "可邮寄",
            "dt_boxes": [
                [493, 261],
                [617, 384],
                [577, 423],
                [454, 300]
            ],
            "score": "0.7494261413812637"
        }
    }
    

See details for RapidOCR.

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

If you're not sure about the file name format, learn more about wheel file names.

rapidocr_web-0.1.2-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

Details for the file rapidocr_web-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rapidocr_web-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for rapidocr_web-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 650e70ba303e277260f84e68270ba39129905d64173ad21ec45207fbc190e279
MD5 034b279db8b417bd610074a29712a58f
BLAKE2b-256 9f9aaf5f7836da29daa43df3988abe1811fe1bb3d7fa0b38eae4a982d2e05688

See more details on using hashes here.

Supported by

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