import requests import base64 import os import re import time import json def ocr(path): with open(path, 'rb') as f: base64_data = base64.b64encode(f.read()) s = base64_data.decode() js = json.loads(requests.post('http://106.75.61.190:10811/spooo', json={'b64': s}).text) print(js) time.sleep(0.1) s = js['texts'].replace('',' ').replace( '', ' ') return s if __name__ == '__main__': ...