Ucas-HaoranWei / GOT-OCR2.0

Official code implementation of General OCR Theory: Towards OCR-2.0 via a Unified End-to-end Model
6.1k stars 525 forks source link

有serving代码吗 #120

Open FanWan opened 1 month ago

Mini-Right commented 1 month ago

我添加了api服务 https://github.com/Mini-Right/GOT-OCR2.0

服务启动

cd GOT-OCR2.0/GOT-OCR-2.0-master
python3 GOT/demo/run_ocr_serve.py

接口调用

import requests

def invoke():
    url = "http://127.0.0.1:6006/inference"
    img_path = r"image_path"
    files = {'file': open(img_path, 'rb')}
    response = requests.post(url, files=files)
    print(response.text)

if __name__ == '__main__':
    invoke()