cURL
鉴权
string
header
必填
千问云 API Key。详见获取 API Key。
检测图像中是否包含符合要求的人脸
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"
}千问云 API Key。详见获取 API Key。
模型名称,固定为 facechain-facedetect。
输入图像参数。
显示子属性
待检测图像的公网可访问 URL 列表。
图像要求:
选图建议(用于人物写真生成):
[
"https://example.com/image1.png",
"https://example.com/image2.jpg"
]生成参数。当前无可用参数,传空对象 {} 即可。
显示子属性
请求唯一标识符,用于链路追踪和问题排查。
使用量统计。当前为空对象。
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"
}