泰国身份证防伪
检测泰国身份证上的伪造人脸,例如深度伪造人脸。
代码示例:
curl --location --request POST 'https://api.ekycpro.com/v1/th_card/antifake' \--header 'Content-Type: application/x-www-form-urlencoded' \--header 'X-API-Key: AbcdEfgh' \--data-urlencode 'img=BASE64_ENCODE_VALUE'
输入人脸为伪造时的响应
{ "status": "OK", "message": { "blur": { "isBlur": "no", "score": 0 }, "deepfake": { "isSpoofing": "yes", "score": 95 }, "print": { "isPrint": "no", "score": 1 } }}
输入人脸非伪造时的响应
{ "status": "OK", "message": { "blur": { "isBlur": "no", "score": 0 }, "deepfake": { "isSpoofing": "no", "score": 8 }, "print": { "isPrint": "no", "score": 1 } }}
输入人脸为模糊图像时的响应
{ "status": "OK", "message": { "blur": { "isBlur": "yes", "score": 91 }, "deepfake": { "isSpoofing": "no", "score": 8 }, "print": { "isPrint": "no", "score": 1 } }}
输入人脸为黑白打印图像时的响应
{ "status": "OK", "message": { "blur": { "isBlur": "yes", "score": 91 }, "deepfake": { "isSpoofing": "no", "score": 8 }, "print": { "isPrint": "yes", "score": 100 } }}
识别失败时的响应
{ "status": "FAIL", "message": "check input image and retry"}
无效请求参数时的响应
{ "status": "INVALID_REQUEST", "message": "check request params"}
无效图像格式时的响应
{ "status": "IMAGE_INVALID_FORMAT", "message": "image format not support"}
图像大小超过 4M 时的响应
{ "status": "IMAGE_INVALID_SIZE", "message": "image larger than 4M"}
服务器错误时的响应
{ "status": "INNER_ERROR", "message": "Inner error, please retry later"}
HTTP 请求
POST https://api.ekycpro.com/v1/th_card/antifake
请求参数
参数 | 描述 |
---|---|
img | string ,Base64 编码的图像。建议图像大小小于 200KB,以便在 2 秒内返回结果,否则返回时间会更长。 |
响应格式
字段 | 描述 |
---|---|
isSpoofing | yes 表示伪造,no 表示非伪造 |
deepfake score | 这是伪造人脸的置信度,范围为[0, 100]。默认大于 85 分为伪造人脸 |
isBlur | yes 表示模糊,no 表示非模糊 |
blur score | 这是模糊人脸的置信度,范围为[0, 100]。默认大于 70 分为模糊人脸 |
isPrint | yes 表示黑白打印图像,no 表示非黑白打印图像 |
print score | 这是黑白打印图像的置信度,范围为[0, 100]。默认大于 70 分为黑白打印人脸 |
状态码
状态 | 描述 |
---|---|
OK | 收费 ,成功 |
FAIL | 收费 ,图像识别错误,请检查输入图像 |
INVALID_REQUEST | 免费 ,无效的请求参数 |
IMAGE_INVALID_FORMAT | 免费 ,无效的图像格式,图像格式应为 jpeg/jpg/png/bmp 之一 |
IMAGE_INVALID_SIZE | 免费 ,无效的图像大小,应小于 4M |
INNER_ERROR | 免费 ,服务器错误 |