该镜像为rapidocr_api
部署的GPU版本。采用的是PyTorch GPU版本作为推理引擎。
1、选择RapidOCR_Torch_GPU的云端镜像创建实例
2、然后在这里选择显卡并部署,推荐选择4090
3、点击开机并启动
4、点击登录
5、进入镜像里面,执行rapidocr_api
:
6.、查看启动镜像的外网ip:
⚠️注意:下面的IP地址需要更换为启动该实例后的外网IP
💻 命令行使用:
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())