We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker镜像服务 的方法怎么用代码的方式上传图像,并将识别结果保存到本地
The text was updated successfully, but these errors were encountered:
由于一直无法编译GPU,但是可以用docker启动本地服务,因此可以用post请求的方式来获得识别结果,例子如下:(运行下面的代码之前要记得开启docker服务) import requests import json import base64
imgpath = './timg.jpg' imgbase64 = None with open(imgpath,'rb') as f: imgbase64 = base64.b64encode(f.read()) imgString2 = imgbase64.decode('utf-8') imgString = 'base64,' + imgString2 data = {"imgString":imgString} header = {'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'} postUrl = 'http://127.0.0.1:8080/text' data = json.dumps(data) r = requests.post(postUrl, data=data, headers=header).text print(r)
Sorry, something went wrong.
No branches or pull requests
docker镜像服务 的方法怎么用代码的方式上传图像,并将识别结果保存到本地
The text was updated successfully, but these errors were encountered: