def demo():
    appcode = APPCODE
    url = 'https://form.market.alicloudapi.com/api/predict/ocr_table_parse'
    img_file = path_image
    is_old_format = False
    config = {'format': 'html', 'finance': False, 'dir_assure': False}
    img_base64data = get_img_base64(img_file)
    (stat, header, content) = predict(url, appcode, img_base64data, config, is_old_format)
    if (stat != 200):
        print('Http status code: ', stat)
        print('Error msg in header: ', (header['x-ca-error-message'] if ('x-ca-error-message' in header) else ''))
        print('Error msg in body: ', content)
        exit()
    if is_old_format:
        result_str = json.loads(content)['outputs'][0]['outputValue']['dataValue']
    else:
        result_str = content
    print(result_str)
def demo():
    appcode = APPCODE
    url = 'https://form.market.alicloudapi.com/api/predict/ocr_table_parse'
    img_file = path_image
    is_old_format = False
    config = {'format': 'html', 'finance': False, 'dir_assure': False}
    img_base64data = get_img_base64(img_file)
    (stat, header, content) = predict(url, appcode, img_base64data, config, is_old_format)
    if (stat != 200):
        print('Http status code: ', stat)
        print('Error msg in header: ', (header['x-ca-error-message'] if ('x-ca-error-message' in header) else ))
        print('Error msg in body: ', content)
        exit()
    if is_old_format:
        result_str = json.loads(content)['outputs'][0]['outputValue']['dataValue']
    else:
        result_str = content
    print(result_str)