python调用搜狗OCR接口实现图片文字识别

2019-04-15 18:39发布

import requests multiple_files = {'pic': ('1111111.jpg', open( r'QQ截图20180905172943.jpg', 'rb'), 'image/jpg')} resp = requests.post(r'http://ocr.shouji.sogou.com/v2/ocr/json', files=multiple_files) str_json = resp.json() print(str_json)