Skip to content

RapidAI/RapidOCRAPI

Repository files navigation


PyPI SemVer2.0

简介

  • 该包是将rapidocr_onnxruntime库做了API封装,采用FastAPI + uvicorn实现。
  • 定位是一个快速调用rapidocr_onnxruntime的API接口,没有考虑多进程处理并发请求,如果有这需求的小伙伴,可以看看gunicorn等。

安装

pip install rapidocr_api

使用

启动服务

# 默认参数启动
rapidocr_api

# 指定参数:端口与进程数量;
rapidocr_api -ip 0.0.0.0 -p 9005 -workers 2

调用服务

curl -F image_file=@1.png http://0.0.0.0:9003/ocr

Python脚本使用:

import requests

url = 'http://localhost:9003/ocr'
img_path = 'tests/test_files/ch_en_num.jpg'

with open(img_path, 'rb') as f:
    file_dict = {'image_file': (img_path, f, 'image/png')}
    response = requests.post(url, files=file_dict, timeout=60)

print(response.json())

文档

完整文档请移步:docs

About

🗝️ A cross platform OCR API Library based on RapidOCR

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy