# 人力OCR

## convert_json.py

```python
# 项目url
url = 'http://192.168.199.27:18040'
# 目标文件夹
imgs_path = './HR_OCR/utils/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

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

