123456789101112 |
- import base64
- import requests
- url = 'http://0.0.0.0:8080'
- def send_request(image_path, image_type):
- with open(image_path, 'rb') as f:
- img_str: str = base64.encodebytes(f.read()).decode('utf-8')
- r = requests.post(f'{url}/ocr_system/schoolcert', json={'image': img_str, 'image_type': image_type})
- print(r.json())
- return r.json()
|