跳转到主要内容
人像写真

FaceChain — 图像检测

检测图像中是否包含符合要求的人脸

POST
/services/vision/facedetection/detect
cURL
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/vision/facedetection/detect' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
  "model": "facechain-facedetect",
  "input": {
    "images": [
      "https://example.com/image1.png",
      "https://example.com/image2.jpg",
      "https://example.com/image3.png"
    ]
  },
  "parameters": {}
}'
{
  "output": {
    "is_face": [
      true,
      false,
      true
    ],
    "failed_reason": [
      "",
      "no face detected",
      ""
    ]
  },
  "usage": {},
  "request_id": "549e0573-f630-9c17-8df2-08f605b4a646"
}
FaceChain 人物图像检测用于判断输入图像是否包含符合要求的人脸,通常在人物写真生成前作为图像筛选步骤使用。 限制:每个账号 QPS 上限为 5。

鉴权

string
header
必填

千问云 API Key。详见获取 API Key

请求体

application/json
enum<string>
必填

模型名称,固定为 facechain-facedetect

facechain-facedetect
facechain-facedetect
object
必填

输入图像参数。

object

生成参数。当前无可用参数,传空对象 {} 即可。

响应

200-application/json
string

请求唯一标识符,用于链路追踪和问题排查。

549e0573-f630-9c17-8df2-08f605b4a646
object

检测结果。

object

使用量统计。当前为空对象。