Untitled

 avatar
unknown
plain_text
3 years ago
617 B
8
Indexable
import requests

api_key ="12306f71ce2f46b88957"
def ocr_space_file(filename, overlay=False, api_key=api_key, language='eng'):
    

    payload = {'isOverlayRequired': overlay,
               'apikey': api_key,
               'language': language,
               }
    with open(filename, 'rb') as f:
        r = requests.post('https://api.ocr.space/parse/image',
                          files={filename: f},
                          data=payload,
                          )
    return r.content.decode()



test_file = ocr_space_file(filename='111.PNG', language='chs')

print(test_file);
Editor is loading...