文档

EMO图像检测API详情

更新时间:

EMO-detect模型,用于确认输入的人物肖像图片是否符合EMO模型的输入规范。本文档介绍了该模型提供的图像检测能力的API调用方法。

模型概览

模型名

模型简介

emo-detect

emo-detect是一个特定的图像检测模型,用于检测输入的图片是否满足emo模型所需的人物肖像图片规范。

HTTP调用接口

功能描述

该模型用于检测输入的图片是否满足“EMO 视频生成API”所需的人物肖像图片规范。

前提条件

作业提交接口调用

POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/face-detect

入参描述

字段

类型

传参方式

必选

描述

示例值

Content-Type

String

Header

请求类型:application/json

application/json

Authorization

String

Header

API-Key,例如:Bearer d1**2a

Bearer d1**2a

model

String

Body

指明需要调用的模型,填入在百炼平台部署成功的模型名称

emo-detect-xxx

input.image_url

String

Body

需要检测的图像 URL。

图像最小边长≥400,最大边长≤7000,格式支持:jpg、png、jpeg、bmp、webp

"image_url": "http://a/a.jpg"

parameters.ratio

String

Body

希望检测确认的画幅,可选 "1:1"或"3:4"。

1:1适用于头像图片,3:4适用于半身像图片。默认值为"1:1"

"ratio": "1:1"

出参描述

字段

类型

描述

示例值

output.face_bbox

Array

算法检测到的人脸区域 bbox,可将该值作为EMO视频生成API的入参。

人脸区域坐标(x1,y1,x2,y2), 对应左上和右下两个点的坐标

[10,20,30,40]

output.ext_bbox

Array

算法预测的动态区域 bbox,可将该值作为EMO视频生成API的入参。该区域的宽高比与入参画幅一致。

动态区域坐标(x1,y1,x2,y2),对应左上和右下两个点的坐标

[10,20,30,40]

request_id

String

本次请求的系统唯一码

7574ee8f-38a3-4b1e-9280-11c33ab46e51

检查不通过原因

output.message

原因说明

建议用户侧提示

The input image has no human body. Please upload other image with single person.

输入图片中没有人

未检测到人脸

The input image has multi human bodies. Please upload other image with single person.

输入图片中有多人

请上传单人照

The proportion of the detected person in the picture is too large or too small, please upload other image.

上传图片中人物占比不符合要求

上传图片中人脸占比过大/过小

The image resolution is invalid, please make sure that the largest length of image is smaller than 7000, and the smallest length of image is larger than 400.

上传图片大小不符合要求

分辨率不得低于400*400

分辨率不得高于7000*7000

The value of the image is invalid, please upload other clearer image.

上传图片过暗不符合要求

请确保图片中人脸清晰

The pose of the detected person is invalid, please upload other image with the front view.

上传图片中人物背身不符合要求

请确保图片中人物正面朝向镜头

The pose of the detected face is invalid, please upload other image with whole face.

上传图片中人物面部姿态不符合要求(要求面部可见)

请确保图片中人脸完整无遮挡

The pose of the detected face is invalid, please upload other image with the expected oriention.

上传图片中人物面部姿态不符合要求(要求面部朝向无严重偏移)

请确保图片中人脸朝向无偏斜

The pose of the detected person is invalid, please upload other image with whole body, or change the ratio parameter to 1:1。

上传图片中人物姿态不符合要求(头像照要求头部完整可见,半身照要求髋部以上完整可见)

请确保图片中人脸完整可见(针对1:1画幅)

请确保图片中人物上半身完整可见(针对3:4画幅)

请求示例

curl --location --request POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/face-detect' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "<YOUR_MODEL>",
  "input": {
      "image_url":"http://xxx/1.jpg"
  },
  "parameters": {
      "ratio": "1:1"
  }
}'

响应示例(通过

{
    "output":{
        "face_bbox":[10,20,30,40], #人脸bbox
        "ext_bbox": [40,60,80,90], #动态区域bbox,
    },
    "usage":{
        "image_count":1
    },
    "request_id":"c56f62df-724e-9c19-96bd-308627cf5262"
}

响应示例(不通过)

{
    "output":{
      "code": "",
      "message": "",
    },
    "usage":{
        "image_count":1
    },
    "request_id":"c56f62df-724e-9c19-96bd-308627cf5262"
}

状态码说明

大模型服务平台通用状态码请查阅:状态码说明

同时本模型还有如下特定错误码:

http 返回码*

错误码(code)

错误信息(message)

含义说明

400

InvalidParameter

The request is missing required parameters or in a wrong format, please check the parameters that you send.

入参格式不对

400

InvalidParameter.Ratio

The request parameter is invalid, please check the request parameter.

画幅入参不合规,可选"1:1"或"3:4"

400

InvalidURL

The request URL is invalid, please check the request URL is available and the request image format is one of the following types: JPEG, JPG, PNG, BMP, and WEBP.

输入图片下载失败,请检查网络或者输入格式

400

InvalidFile.NoHuman

The input image has no human body. Please upload other image with single person.

输入图片中没有人

400

InvalidFile.MultiHuman

The input image has multi human bodies. Please upload other image with single person.

输入图片中有多人

400

InvalidFile.BodyProportion

The proportion of the detected person in the picture is too large or too small, please upload other image.

上传图片中人物占比不符合要求

400

InvalidFile.Resolution

The image resolution is invalid, please make sure that the largest length of image is smaller than 7000, and the smallest length of image is larger than 400.

上传图片大小不符合要求

400

InvalidFile.Value

The value of the image is invalid, please upload other clearer image.

上传图片过暗不符合要求

400

InvalidFile.FrontBody

The pose of the detected person is invalid, please upload other image with the front view.

上传图片中人物背身不符合要求

400

InvalidFile.FullFace

The pose of the detected face is invalid, please upload other image with whole face.

上传图片中人物面部姿态不符合要求(要求面部可见)

400

InvalidFile.FacePose

The pose of the detected face is invalid, please upload other image with the expected oriention.

上传图片中人物面部姿态不符合要求(要求面部朝向无严重偏移)

400

InvalidFile.FullBody

The pose of the detected person is invalid, please upload other image with whole body, or change the ratio parameter to 1:1。

上传图片中人物姿态不符合要求(头像照要求头部完整可见,半身照要求髋部以上完整可见)