4.6.201909271049 • Published 6 years ago
@dfeidao/fd-an000003 v4.6.201909271049
百度智能云-护照识别
Installation
yarn add --dev @dfeidao/fd-an000003参数
| 参数 | 描述 |
|---|---|
| app_id | 从百度智能云申请的AppID |
| api_key | 从百度智能云获取的ApiKey |
| secret_key | 从百度智能云获取的Secret key |
| image | 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式 |
返回值
| 名称 | 说明 |
|---|---|
| birthday | 生日 |
| card_num | 护照号码 |
| country_code | 国家码 |
| issue_date | 签发日期 |
| issue_place | 护照签发地 |
| name | 姓名 |
| name_py | 姓名拼音 |
| place_of_birth | 出生地点 |
| sex | 性别 |
| valid_date | 有效期至 |
Example
- 客户端通过调用
import img2base64 from '@dfeidao/atom-web/file/img2base64';原子操作,把base64格式的图片传到服务端 - 服务端调用
@dfeidao/fd-an000003护照识别原子操作进行识别 - 需要注意的是 app_id, api_key, secret_key 不要出现在客户端,仅限在服务端出现
import an003 from '@dfeidao/fd-an000003';
export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders): Promise<IWebResult> {
try {
const img = message.img;
const res = await an003('app_id', 'api_key', 'secret_key', message.img);
} catch (error) {
// 获取到具体的错误信息
console.log(error);
}
}4.6.201909271049
6 years ago
4.6.201909241039
6 years ago
4.6.201909121206
6 years ago
4.6.201909041723
6 years ago
4.6.201908121119
6 years ago
4.6.201908121115
6 years ago
4.6.201908121109
6 years ago
4.6.201907040922
6 years ago
4.6.201907021246
6 years ago
4.6.201907021243
6 years ago
4.6.201907021236
6 years ago
4.6.201907021235
6 years ago
4.6.201907021233
6 years ago
4.6.201907021226
6 years ago