zeke-chin affce2daf6 fix send_request token错误 há 2 anos atrás
..
README.md a0b1c05114 add README 和 示例文件 há 2 anos atrás
convert_json.py affce2daf6 fix send_request token错误 há 2 anos atrás
suffix.py bf079b5c86 fix send_request token错误 há 2 anos atrás

README.md

人力OCR

convert_json.py

# 项目url
url = 'http://192.168.199.27:18040'
# 目标文件夹
imgs_path = './HR_OCR/to_md/example/img'

def send_request(img_path, image_type = 0):
    with open(img_path, 'rb') as f:
        img_str: str = base64.encodebytes(f.read()).decode('utf-8')
        data = {
            'image': img_str,
            'image_type': image_type
        }
        idc_header = {
            'Content-Type': 'application/json',
            'Authorization': 'Bearer 4e00c444-620b-4d3c-85f4-777e64276f0e'
        }
        r = requests.post(f'{url}/cettest/cet', json=data, headers=idc_header)
        # r = requests.post(f'{url}/hkbsbtest/regbook', json=data)
        print(r.json())
        return r.json()

suffix.py

# 需要格式化的目的文件夹路径
target_path = './HR_OCR/to_md/example/img'