yan chuanli 442957d8f6 add filed 2 years ago
..
README.md a0b1c05114 add README 和 示例文件 2 years ago
convert_json.py 442957d8f6 add filed 2 years ago
suffix.py 0fd86add65 等待被修复: 户口本多类型导致 to_md 不准确 2 years ago

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'