人脸比对

第 1 步,共 3 步
1
源图
2
目标图
3
分析

源图身份

用于核验的主要生物特征签名。

menu_bookAPI 参考:人脸比对expand_more

官方文档: docs.verifik.co/biometrics/compare

Verifik 公开页面可能描述其他环境的额外字段。本 HumanAuthn 演示调用接受 gallery、probe 与可选 compare_min_score 的 Verifik 路由。

POST /v2/face-recognition/compare

将探针图与图库图比对并返回相似度分数。当分数达到 compare_min_score(或省略时的服务器默认值)时,后端设置 passed。

字段
Content-Typeapplication/json
AuthorizationBearer <token>
参数类型必填说明
gallerystring[]参考人脸,base64(无 data URL 前缀)
probestring[]待匹配人脸,base64
compare_min_scorenumber0.67 至 0.95。省略时服务器默认 0.85
await fetch("https://api.verifik.co/v2/face-recognition/compare", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${accessToken}`,
  },
  body: JSON.stringify({
    gallery: ["<base64>"],
    probe: ["<base64>"],
    compare_min_score: 0.85,
  }),
});
// 200 OK, example shape
{
  "id": "…",
  "data": {
    "result": {
      "score": 0.91,
      "compare_min_score": 0.85,
      "passed": true
    },
    "compare_min_score": 0.85
  },
  "signature": {
    "message": "Certified by Verifik.co",
    "dateTime": "…"
  }
}
  • 图像必须为真实 base64 载荷。过短字符串会被拒绝(例如 412:only_images_in_base64)。
  • 「比对最低分数」滑块在请求上设置 compare_min_score(0.67 至 0.95;起始为 API 客户端默认值 0.85)。
  • 响应通常包含 id 与 data 旁的签名字段。