手势关键点检测

本文介绍人脸人体(facebody)类目下的手势关键点检测HandPosture的语法及示例。

功能描述

手势关键点检测能力可以获取手势的二十一个关键点信息。

关于该接口功能的示例图如下:

说明
  • 您可以进入在线咨询获取在线人工帮助。
  • 当前能力可在视觉智能开放平台有完整的免费产品体验,您可以单击立即试用对该能力进行更直观试用以及在线购买。
  • 阿里云视觉智能开放平台视觉AI能力API接入、接口使用或问题咨询等,请通过钉钉群(23109592)加入阿里云视觉智能开放平台咨询群联系我们。

接入指引

1. 注册阿里云账号:打开阿里云官网,在阿里云官网右上角,单击立即注册,按照操作提示完成账号注册。

2. 开通能力:请确保您已开通人脸人体服务,若未开通服务请立即开通

说明 本能力支持企业或个人认证用户开通。更多实名认证操作信息,请参见实名认证

3. 创建AccessKey:请确保您已创建AccessKey,如果您使用的是子账号AccessKey,您需要给子账号赋予AliyunVIAPIFullAccess权限,具体操作,请参见RAM授权

4. 在线调试(可选):您可以通过OpenAPI Explorer在线调试能力,查看完整的调用示例代码及SDK依赖信息,也可以下载完整的工程。

5. 开发接入步骤:

  • SDK总览中选择您要接入使用的SDK语言。
  • 在对应语言的SDK文档中找到AI类目为人脸人体(facebody)的SDK包进行安装。
  • 参考文档中提供的示例代码进行适当修改后调用。

6. 客户端直接调用:该能力常用的客户端调用方式包括以下几种。

输入限制

  • 图像格式:JPEG、JPG、BMP、PNG。
  • 图像大小:不超过4 MB。
  • URL地址中不能包含中文字符。

计费说明

手势关键点检测能力目前处于公测期,可免费调用。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String HandPosture

系统规定参数。取值:HandPosture

ImageURL String http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/facebody/HandPosture/HandPosture3.jpg

图像URL地址。推荐使用上海地域的OSS链接,对于文件在本地或者非上海地域OSS链接的情况,请参见文件URL处理

返回数据

名称

类型

示例值

描述

RequestId String 99CE0601-FA61-4A41-BBF0-72D3E1FF5139

请求ID。

Data Object

返回的结果数据内容。

Outputs Array of Output

手势检测结果。

HandCount Integer 1

手掌的个数。

Results Array of Result

手势类别。

Hands Object

手势关键点信息。

KeyPoints Array of KeyPoint

关键点坐标,是相对坐标,即相对于图像尺寸的坐标。

Positions Array of Position

相对于图像尺寸的关键点坐标。

Points Array of Float [0.5656, 0.4567]

关键点的坐标,x和y的取值范围为0~1。相对于图像宽度width和图像高度height的相对坐标,实际坐标为x*widthy*height

Label String thumb

关键点的标签。

Confident Float 0.555

置信度。

Box Object

手势的检测框信息。

Positions Array of Position

手的检测框信息。格式为 [左上, 右上, 右下, 左下]

Points Array of Float [0.5656, 0.4567]

手体检测框的坐标,x和y的取值范围为0~1。相对于图像宽度width和图像高度height的相对坐标,实际坐标为x*widthy*height

Confident Float 0.555

手势检测框的置信度。

MetaObject Object

图像基本信息。

Width Integer 500

图像宽度,单位像素。

Height Integer 600

图像高度,单位像素。

SDK参考

阿里云视觉AI人脸人体类目下的手势关键点检测能力推荐使用SDK调用,支持多种编程语言,调用时请选择AI类目为人脸人体(facebody)的SDK包,文件参数通过SDK调用可支持本地文件及任意URL,具体可参见SDK总览

示例

请求示例

http(s)://facebody.cn-shanghai.aliyuncs.com/?Action=HandPosture   //更多关于访问域名(Endpoint)信息,请参见:https://help.aliyun.com/document_detail/143103.html
&ImageURL=http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/facebody/HandPosture/HandPosture3.jpg
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<RequestId>99CE0601-FA61-4A41-BBF0-72D3E1FF5139</RequestId>
<Data>
    <MetaObject>
        <Height>360</Height>
        <Width>640</Width>
    </MetaObject>
    <Outputs>
        <Results>
            <Hands>
                <Confident>0.99994850158691406</Confident>
                <KeyPoints>
                    <Label>0</Label>
                    <Positions>
                        <Points>0.60814106464385986</Points>
                        <Points>0.57843714952468872</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>1</Label>
                    <Positions>
                        <Points>0.5954553484916687</Points>
                        <Points>0.53584885597229</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>2</Label>
                    <Positions>
                        <Points>0.58072149753570557</Points>
                        <Points>0.52881228923797607</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>3</Label>
                    <Positions>
                        <Points>0.55731791257858276</Points>
                        <Points>0.53051036596298218</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>4</Label>
                    <Positions>
                        <Points>0.556272029876709</Points>
                        <Points>0.54263561964035034</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>5</Label>
                    <Positions>
                        <Points>0.58563053607940674</Points>
                        <Points>0.5606304407119751</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>6</Label>
                    <Positions>
                        <Points>0.55570542812347412</Points>
                        <Points>0.56016099452972412</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>7</Label>
                    <Positions>
                        <Points>0.527125895023346</Points>
                        <Points>0.53607034683227539</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>8</Label>
                    <Positions>
                        <Points>0.50249892473220825</Points>
                        <Points>0.52858757972717285</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>9</Label>
                    <Positions>
                        <Points>0.58144932985305786</Points>
                        <Points>0.600288450717926</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>10</Label>
                    <Positions>
                        <Points>0.548987090587616</Points>
                        <Points>0.57786983251571655</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>11</Label>
                    <Positions>
                        <Points>0.51771032810211182</Points>
                        <Points>0.56192481517791748</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>12</Label>
                    <Positions>
                        <Points>0.48404961824417114</Points>
                        <Points>0.55325514078140259</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>13</Label>
                    <Positions>
                        <Points>0.57908332347869873</Points>
                        <Points>0.62439030408859253</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>14</Label>
                    <Positions>
                        <Points>0.5494731068611145</Points>
                        <Points>0.615152895450592</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>15</Label>
                    <Positions>
                        <Points>0.52025854587554932</Points>
                        <Points>0.58855414390563965</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>16</Label>
                    <Positions>
                        <Points>0.48847651481628418</Points>
                        <Points>0.55619245767593384</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>17</Label>
                    <Positions>
                        <Points>0.57136648893356323</Points>
                        <Points>0.65912783145904541</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>18</Label>
                    <Positions>
                        <Points>0.54293251037597656</Points>
                        <Points>0.617222249507904</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>19</Label>
                    <Positions>
                        <Points>0.53020155429840088</Points>
                        <Points>0.606507420539856</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>20</Label>
                    <Positions>
                        <Points>0.50880300998687744</Points>
                        <Points>0.58464843034744263</Points>
                    </Positions>
                </KeyPoints>
            </Hands>
            <Box>
                <Confident>0.71226352453231812</Confident>
                <Positions>
                    <Points>0.4974265992641449</Points>
                    <Points>0.50328123569488525</Points>
                </Positions>
                <Positions>
                    <Points>0.62906938791275024</Points>
                    <Points>0.50328123569488525</Points>
                </Positions>
                <Positions>
                    <Points>0.62906938791275024</Points>
                    <Points>0.65238773822784424</Points>
                </Positions>
                <Positions>
                    <Points>0.4974265992641449</Points>
                    <Points>0.65238773822784424</Points>
                </Positions>
            </Box>
        </Results>
        <Results>
            <Hands>
                <Confident>0.9999852180480957</Confident>
                <KeyPoints>
                    <Label>0</Label>
                    <Positions>
                        <Points>0.393640398979187</Points>
                        <Points>0.59868341684341431</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>1</Label>
                    <Positions>
                        <Points>0.42132681608200073</Points>
                        <Points>0.62495428323745728</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>2</Label>
                    <Positions>
                        <Points>0.43745431303977966</Points>
                        <Points>0.689828097820282</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>3</Label>
                    <Positions>
                        <Points>0.4462774395942688</Points>
                        <Points>0.77660030126571655</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>4</Label>
                    <Positions>
                        <Points>0.45127806067466736</Points>
                        <Points>0.83825963735580444</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>5</Label>
                    <Positions>
                        <Points>0.44249773025512695</Points>
                        <Points>0.71941894292831421</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>6</Label>
                    <Positions>
                        <Points>0.44476762413978577</Points>
                        <Points>0.81073153018951416</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>7</Label>
                    <Positions>
                        <Points>0.45668521523475647</Points>
                        <Points>0.86831820011138916</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>8</Label>
                    <Positions>
                        <Points>0.45888024568557739</Points>
                        <Points>0.93340605497360229</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>9</Label>
                    <Positions>
                        <Points>0.41096386313438416</Points>
                        <Points>0.7522350549697876</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>10</Label>
                    <Positions>
                        <Points>0.41827210783958435</Points>
                        <Points>0.83636075258255</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>11</Label>
                    <Positions>
                        <Points>0.43387466669082642</Points>
                        <Points>0.87332594394683838</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>12</Label>
                    <Positions>
                        <Points>0.44423216581344604</Points>
                        <Points>0.9019133448600769</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>13</Label>
                    <Positions>
                        <Points>0.38739094138145447</Points>
                        <Points>0.76350539922714233</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>14</Label>
                    <Positions>
                        <Points>0.39671486616134644</Points>
                        <Points>0.82768404483795166</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>15</Label>
                    <Positions>
                        <Points>0.41303998231887817</Points>
                        <Points>0.84740370512008667</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>16</Label>
                    <Positions>
                        <Points>0.43770962953567505</Points>
                        <Points>0.86880898475646973</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>17</Label>
                    <Positions>
                        <Points>0.3712017834186554</Points>
                        <Points>0.760955810546875</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>18</Label>
                    <Positions>
                        <Points>0.387716680765152</Points>
                        <Points>0.83686923980712891</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>19</Label>
                    <Positions>
                        <Points>0.39462429285049438</Points>
                        <Points>0.84625548124313354</Points>
                    </Positions>
                </KeyPoints>
                <KeyPoints>
                    <Label>20</Label>
                    <Positions>
                        <Points>0.41109806299209595</Points>
                        <Points>0.83971405029296875</Points>
                    </Positions>
                </KeyPoints>
            </Hands>
            <Box>
                <Confident>0.59800052642822266</Confident>
                <Positions>
                    <Points>0.35801595449447632</Points>
                    <Points>0.54407310485839844</Points>
                </Positions>
                <Positions>
                    <Points>0.47501063346862793</Points>
                    <Points>0.54407310485839844</Points>
                </Positions>
                <Positions>
                    <Points>0.47501063346862793</Points>
                    <Points>0.93112361431121826</Points>
                </Positions>
                <Positions>
                    <Points>0.35801595449447632</Points>
                    <Points>0.93112361431121826</Points>
                </Positions>
            </Box>
        </Results>
        <HandCount>2</HandCount>
    </Outputs>
</Data>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "99CE0601-FA61-4A41-BBF0-72D3E1FF5139",
  "Data" : {
    "MetaObject" : {
      "Height" : 360,
      "Width" : 640
    },
    "Outputs" : [ {
      "Results" : [ {
        "Hands" : {
          "Confident" : "0.99994850158691406",
          "KeyPoints" : [ {
            "Label" : "0",
            "Positions" : [ {
              "Points" : [ "0.60814106464385986", "0.57843714952468872" ]
            } ]
          }, {
            "Label" : "1",
            "Positions" : [ {
              "Points" : [ "0.5954553484916687", "0.53584885597229" ]
            } ]
          }, {
            "Label" : "2",
            "Positions" : [ {
              "Points" : [ "0.58072149753570557", "0.52881228923797607" ]
            } ]
          }, {
            "Label" : "3",
            "Positions" : [ {
              "Points" : [ "0.55731791257858276", "0.53051036596298218" ]
            } ]
          }, {
            "Label" : "4",
            "Positions" : [ {
              "Points" : [ "0.556272029876709", "0.54263561964035034" ]
            } ]
          }, {
            "Label" : "5",
            "Positions" : [ {
              "Points" : [ "0.58563053607940674", "0.5606304407119751" ]
            } ]
          }, {
            "Label" : "6",
            "Positions" : [ {
              "Points" : [ "0.55570542812347412", "0.56016099452972412" ]
            } ]
          }, {
            "Label" : "7",
            "Positions" : [ {
              "Points" : [ "0.527125895023346", "0.53607034683227539" ]
            } ]
          }, {
            "Label" : "8",
            "Positions" : [ {
              "Points" : [ "0.50249892473220825", "0.52858757972717285" ]
            } ]
          }, {
            "Label" : "9",
            "Positions" : [ {
              "Points" : [ "0.58144932985305786", "0.600288450717926" ]
            } ]
          }, {
            "Label" : "10",
            "Positions" : [ {
              "Points" : [ "0.548987090587616", "0.57786983251571655" ]
            } ]
          }, {
            "Label" : "11",
            "Positions" : [ {
              "Points" : [ "0.51771032810211182", "0.56192481517791748" ]
            } ]
          }, {
            "Label" : "12",
            "Positions" : [ {
              "Points" : [ "0.48404961824417114", "0.55325514078140259" ]
            } ]
          }, {
            "Label" : "13",
            "Positions" : [ {
              "Points" : [ "0.57908332347869873", "0.62439030408859253" ]
            } ]
          }, {
            "Label" : "14",
            "Positions" : [ {
              "Points" : [ "0.5494731068611145", "0.615152895450592" ]
            } ]
          }, {
            "Label" : "15",
            "Positions" : [ {
              "Points" : [ "0.52025854587554932", "0.58855414390563965" ]
            } ]
          }, {
            "Label" : "16",
            "Positions" : [ {
              "Points" : [ "0.48847651481628418", "0.55619245767593384" ]
            } ]
          }, {
            "Label" : "17",
            "Positions" : [ {
              "Points" : [ "0.57136648893356323", "0.65912783145904541" ]
            } ]
          }, {
            "Label" : "18",
            "Positions" : [ {
              "Points" : [ "0.54293251037597656", "0.617222249507904" ]
            } ]
          }, {
            "Label" : "19",
            "Positions" : [ {
              "Points" : [ "0.53020155429840088", "0.606507420539856" ]
            } ]
          }, {
            "Label" : "20",
            "Positions" : [ {
              "Points" : [ "0.50880300998687744", "0.58464843034744263" ]
            } ]
          } ]
        },
        "Box" : {
          "Confident" : "0.71226352453231812",
          "Positions" : [ {
            "Points" : [ "0.4974265992641449", "0.50328123569488525" ]
          }, {
            "Points" : [ "0.62906938791275024", "0.50328123569488525" ]
          }, {
            "Points" : [ "0.62906938791275024", "0.65238773822784424" ]
          }, {
            "Points" : [ "0.4974265992641449", "0.65238773822784424" ]
          } ]
        }
      }, {
        "Hands" : {
          "Confident" : "0.9999852180480957",
          "KeyPoints" : [ {
            "Label" : "0",
            "Positions" : [ {
              "Points" : [ "0.393640398979187", "0.59868341684341431" ]
            } ]
          }, {
            "Label" : "1",
            "Positions" : [ {
              "Points" : [ "0.42132681608200073", "0.62495428323745728" ]
            } ]
          }, {
            "Label" : "2",
            "Positions" : [ {
              "Points" : [ "0.43745431303977966", "0.689828097820282" ]
            } ]
          }, {
            "Label" : "3",
            "Positions" : [ {
              "Points" : [ "0.4462774395942688", "0.77660030126571655" ]
            } ]
          }, {
            "Label" : "4",
            "Positions" : [ {
              "Points" : [ "0.45127806067466736", "0.83825963735580444" ]
            } ]
          }, {
            "Label" : "5",
            "Positions" : [ {
              "Points" : [ "0.44249773025512695", "0.71941894292831421" ]
            } ]
          }, {
            "Label" : "6",
            "Positions" : [ {
              "Points" : [ "0.44476762413978577", "0.81073153018951416" ]
            } ]
          }, {
            "Label" : "7",
            "Positions" : [ {
              "Points" : [ "0.45668521523475647", "0.86831820011138916" ]
            } ]
          }, {
            "Label" : "8",
            "Positions" : [ {
              "Points" : [ "0.45888024568557739", "0.93340605497360229" ]
            } ]
          }, {
            "Label" : "9",
            "Positions" : [ {
              "Points" : [ "0.41096386313438416", "0.7522350549697876" ]
            } ]
          }, {
            "Label" : "10",
            "Positions" : [ {
              "Points" : [ "0.41827210783958435", "0.83636075258255" ]
            } ]
          }, {
            "Label" : "11",
            "Positions" : [ {
              "Points" : [ "0.43387466669082642", "0.87332594394683838" ]
            } ]
          }, {
            "Label" : "12",
            "Positions" : [ {
              "Points" : [ "0.44423216581344604", "0.9019133448600769" ]
            } ]
          }, {
            "Label" : "13",
            "Positions" : [ {
              "Points" : [ "0.38739094138145447", "0.76350539922714233" ]
            } ]
          }, {
            "Label" : "14",
            "Positions" : [ {
              "Points" : [ "0.39671486616134644", "0.82768404483795166" ]
            } ]
          }, {
            "Label" : "15",
            "Positions" : [ {
              "Points" : [ "0.41303998231887817", "0.84740370512008667" ]
            } ]
          }, {
            "Label" : "16",
            "Positions" : [ {
              "Points" : [ "0.43770962953567505", "0.86880898475646973" ]
            } ]
          }, {
            "Label" : "17",
            "Positions" : [ {
              "Points" : [ "0.3712017834186554", "0.760955810546875" ]
            } ]
          }, {
            "Label" : "18",
            "Positions" : [ {
              "Points" : [ "0.387716680765152", "0.83686923980712891" ]
            } ]
          }, {
            "Label" : "19",
            "Positions" : [ {
              "Points" : [ "0.39462429285049438", "0.84625548124313354" ]
            } ]
          }, {
            "Label" : "20",
            "Positions" : [ {
              "Points" : [ "0.41109806299209595", "0.83971405029296875" ]
            } ]
          } ]
        },
        "Box" : {
          "Confident" : "0.59800052642822266",
          "Positions" : [ {
            "Points" : [ "0.35801595449447632", "0.54407310485839844" ]
          }, {
            "Points" : [ "0.47501063346862793", "0.54407310485839844" ]
          }, {
            "Points" : [ "0.47501063346862793", "0.93112361431121826" ]
          }, {
            "Points" : [ "0.35801595449447632", "0.93112361431121826" ]
          } ]
        }
      } ],
      "HandCount" : 2
    } ]
  }
}

错误码

关于手势关键点检测的错误码,详情请参见常见错误码

开源模型体验

更多开源免费模型体验及下载,详见魔搭社区:全身关键点检测-通用领域-2DYOLOX-PAI手部检测模型

安全声明

  • 请确保上传的图片或文件来源符合相应的法律法规。
  • 通过体验调试上传的临时文件有效期为1小时,在24小时后会被系统自动清理删除。