Didit 年龄估算:AI 人脸年龄验证 - Openclaw Skills

作者:互联网

2026-04-17

AI教程

什么是 Didit 年龄估算?

Didit 年龄估算技能提供了一个强大的界面,利用先进的深度学习模型从人脸图像中估算人的年龄。它专为需要在自动化工作流中实现年龄限制、合规性检查或人脸分析的开发人员而设计。通过利用 Openclaw Skills 的这一组件,用户可以实现高精度,对于 18 岁以下的人群,平均绝对误差 (MAE) 低至 1.5 岁。

除了简单的估算,该技能还结合了复杂的活体检测技术以减少欺诈尝试。它支持多种安全级别,包括用于低摩擦消费应用的基于 CNN 的被动检查,以及用于银行和医疗保健等高安全性环境的主动 3D 闪光方法。这使其成为在确保流畅用户体验的同时,维护监管标准的必备工具。

下载入口:https://github.com/openclaw/skills/tree/main/skills/rosasalberto/didit-age-estimation

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install didit-age-estimation

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 didit-age-estimation。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Didit 年龄估算 应用场景

  • 为受限数字内容或电子商务产品实施年龄准入限制。
  • 在金融服务和医疗保健应用程序的注册过程中验证用户年龄。
  • 通过结合年龄估算和被动活体检测来增强身份安全。
  • 自动执行针对不同国家/地区法定成年法律的合规性检查。
Didit 年龄估算 工作原理
  1. 用户通过 Openclaw Skills 界面提供 JPEG、PNG、WebP 或 TIFF 格式的人脸图像。
  2. 该技能使用安全的 x-api-key 将图像传输到 Didit 独立 API。
  3. API 处理图像以识别单张人脸,并根据面部特征估算年龄。
  4. 同时进行活体检测,以确保图像是真人而非欺诈尝试。
  5. 系统返回一个完整的 JSON 对象,包含估算年龄、活体置信度分数以及已批准、已拒绝或审核中的状态。

Didit 年龄估算 配置指南

要开始使用此技能,您需要从 Didit 业务控制台获取有效的 API 密钥。获取后,配置您的环境:

# 设置主要环境变量
export DIDIT_API_KEY="your_didit_api_key_here"

确保处理的图像小于 5MB 且包含一张清晰可见的人脸,以便在 Openclaw Skills 中获得最佳性能。

Didit 年龄估算 数据架构与分类体系

该技能将其输出组织成结构化格式,以便轻松集成到更大的工作流中:

字段 类型 描述
status string 检查结果:Approved(已批准)、Declined(已拒绝)或 In Review(审核中)。
age_estimation float 估算的年龄(例如:24.3)。
score float 活体置信度分数,范围从 0 到 100。
method string 使用的活体检测方法(PASSIVE、FLASHING 或 ACTIVE_3D)。
warnings array 诊断标签,例如 NO_FACE_DETECTED 或 AGE_BELOW_MINIMUM。
name: didit-age-estimation
description: >
  Integrate Didit Age Estimation standalone API to estimate a person's age from a facial image.
  Use when the user wants to estimate age, verify age, implement age gating, check if someone
  is over 18/21, perform age verification for compliance, or use facial analysis for age detection
  using Didit. Includes passive liveness check. Supports configurable thresholds, adaptive age
  estimation with ID verification fallback, and per-country age restrictions.
version: 1.0.0
metadata:
  openclaw:
    requires:
      env:
        - DIDIT_API_KEY
    primaryEnv: DIDIT_API_KEY
    emoji: "??"
    homepage: https://docs.didit.me

Didit Age Estimation API

Overview

Estimates a person's age from a facial image using deep learning. Also performs a passive liveness check to prevent spoofing.

Key constraints:

  • Supported formats: JPEG, PNG, WebP, TIFF
  • Maximum file size: 5MB
  • Image must contain one clearly visible face
  • Accuracy: MAE ±3.5 years overall; ±1.5 years for under-18

Capabilities: Age estimation with confidence scoring, gender estimation, passive liveness detection, configurable age thresholds, per-country age restrictions, adaptive mode with ID verification fallback for borderline cases.

Liveness methods (workflow mode):

Method Security Best For
ACTIVE_3D (Action + Flash) Highest Banking, government, healthcare
FLASHING (3D Flash) High Financial services, identity verification
PASSIVE (single-frame CNN) Standard Low-friction consumer apps

API Reference: https://docs.didit.me/reference/age-estimation-standalone-api


Authentication

All requests require x-api-key header. Get your key from Didit Business Console → API & Webhooks.


Endpoint

POST https://verification.didit.me/v3/age-estimation/

Headers

Header Value Required
x-api-key Your API key Yes
Content-Type multipart/form-data Yes

Request Parameters (multipart/form-data)

Parameter Type Required Default Description
user_image file Yes Facial image (JPEG/PNG/WebP/TIFF, max 5MB)
rotate_image boolean No false Try 0/90/180/270 rotations for non-upright faces
save_api_request boolean No true Save in Business Console Manual Checks
vendor_data string No Your identifier for session tracking

Example

import requests

response = requests.post(
    "https://verification.didit.me/v3/age-estimation/",
    headers={"x-api-key": "YOUR_API_KEY"},
    files={"user_image": ("selfie.jpg", open("selfie.jpg", "rb"), "image/jpeg")},
    data={"vendor_data": "user-123"},
)
print(response.json())
const formData = new FormData();
formData.append("user_image", selfieFile);

const response = await fetch("https://verification.didit.me/v3/age-estimation/", {
  method: "POST",
  headers: { "x-api-key": "YOUR_API_KEY" },
  body: formData,
});

Response (200 OK)

{
  "request_id": "a1b2c3d4-...",
  "liveness": {
    "status": "Approved",
    "method": "PASSIVE",
    "score": 89.92,
    "age_estimation": 24.3,
    "reference_image": "https://example.com/reference.jpg",
    "video_url": null,
    "warnings": []
  },
  "created_at": "2025-05-01T13:11:07.977806Z"
}

Status Values & Handling

Status Meaning Action
"Approved" Age verified above threshold, liveness passed Proceed with your flow
"Declined" Age below minimum or liveness failed Check warnings for specifics
"In Review" Borderline case, needs review Trigger ID verification fallback or manual review

Error Responses

Code Meaning Action
400 Invalid request Check file format, size, parameters
401 Invalid API key Verify x-api-key header
403 Insufficient credits Top up at business.didit.me

Response Field Reference

Field Type Description
status string "Approved", "Declined", "In Review", "Not Finished"
method string "ACTIVE_3D", "FLASHING", or "PASSIVE"
score float 0-100 liveness confidence score
age_estimation float Estimated age in years (e.g. 24.3). null if no face
reference_image string Temporary URL (expires 60 min)
video_url string Temporary URL for active liveness video. null for passive
warnings array {risk, log_type, short_description, long_description}

Accuracy by Age Range

Age Range MAE (years) Confidence
Under 18 1.5 High
18-25 2.8 High
26-40 3.2 High
41-60 3.9 Medium-High
60+ 4.5 Medium

Warning Tags

Auto-Decline

Tag Description
NO_FACE_DETECTED No face found in image
LIVENESS_FACE_ATTACK Spoofing attempt detected
FACE_IN_BLOCKLIST Face matches a blocklist entry

Configurable (Decline / Review / Approve)

Tag Description
AGE_BELOW_MINIMUM Estimated age below configured minimum
AGE_NOT_DETECTED Unable to estimate age (image quality, lighting)
LOW_LIVENESS_SCORE Liveness score below threshold
POSSIBLE_DUPLICATED_FACE Significant similarity with previously verified face

Warning severity: error (→ Declined), warning (→ In Review), information (no effect).


Common Workflows

Basic Age Gate

1. Capture user selfie
2. POST /v3/age-estimation/ → {"user_image": selfie}
3. Check liveness.age_estimation >= your_minimum_age
4. If "Approved" → user meets age requirement
   If "Declined" → check warnings for AGE_BELOW_MINIMUM or liveness failure

Adaptive Age Estimation (Workflow Mode)

1. Configure workflow with age thresholds in Console
2. POST /v3/session/ → create session with age-estimation workflow
3. User takes selfie → system estimates age
4. Clear pass (well above threshold) → Approved instantly
   Clear fail (well below threshold) → Declined
   Borderline case → automatic ID verification fallback
5. If ID fallback triggered: per-country age restrictions apply

Per-Country Age Restrictions

Configure in Console per issuing country:

Country Min Age Overrides
USA 18 Mississippi: 21, Alabama: 19
KOR 19
GBR 18
ARE 21

Use "Apply age of majority" button in Console to auto-populate defaults.