人体关键点识别
<h3>接口描述</h3>
<ul>
<li>对于输入的一张图片(可正常解码,且长宽比适宜),检测图片中的所有人体,输出每个人体的21个主要关键点,包含头顶、五官、脖颈、四肢等部位,同时输出人体的坐标信息和数量。</li>
<li>支持多人检测、人体位置重叠、遮挡、背面、侧面、中低空俯拍、大动作等复杂场景。</li>
<li>21个关键点的位置:头顶、左耳、右耳、左眼、右眼、鼻子、左嘴角、右嘴角、脖子、左肩、右肩、左手肘、右手肘、左手腕、右手腕、左髋部、右髋部、左膝、右膝、左脚踝、右脚踝。</li>
</ul>
<h3>请求地址</h3>
<p><code>https://api.jumdata.com/body/analysis</code></p>
<h3>请求方式</h3>
<ul>
<li>POST</li>
</ul>
<h3>请求格式</h3>
<ul>
<li>form-data</li>
</ul>
<h3>请求参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>appId</td>
<td>String</td>
<td>是</td>
<td>服务商分配的唯一标识</td>
</tr>
<tr>
<td>timestamp</td>
<td>Long</td>
<td>是</td>
<td>当前时间的毫秒数</td>
</tr>
<tr>
<td>sign</td>
<td>String</td>
<td>是</td>
<td>签名,见签名算法说明</td>
</tr>
<tr>
<td>base64</td>
<td>String</td>
<td>否</td>
<td>人体图像base64字符串</td>
</tr>
<tr>
<td>url</td>
<td>String</td>
<td>否</td>
<td>人体图像url链接,url链接长度不超过1024字节,请注意关闭URL防盗链</td>
</tr>
<tr>
<td>file</td>
<td>File</td>
<td>否</td>
<td>人体图像文件,文件类型</td>
</tr>
</tbody>
</table>
<ul>
<li>base64、file、url 必须提供一个,优先级:base64 > file > url</li>
<li>图像最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式,图像文件大小不超过2M</li>
</ul>
<h3>签名算法说明</h3>
<pre><code>sign = sha256( appId + appSecret + timestamp)</code></pre>
<p>用服务商分配的 appId、服务商分配的 appSecret,当前时间毫秒数 timestamp,按上述顺序拼接成字符串,再进行 sha256 哈希得到。如下:</p>
<pre><code class="language-java">String appId = &quot;xyzxy2121zxyz&quot;;
String timestamp = &quot;1555378976238&quot;;
String appSecret = &quot;efcefcef1121cefcefc1212121&quot;;
String str = appId + appSecret + timestamp;
String sign = sha256(str);</code></pre>
<h3>正确返回说明</h3>
<ul>
<li>接口除了返回人体框和每个关键点的坐标信息外,还会输出人体框和关键点的概率分数,实际应用中可以基于概率分数进行过滤,排除掉分数低的误识别“无效人体”。</li>
<li>当关键点得分大于0.2的个数大于3,且人体框的得分大于0.03时,才认为是有效人体。</li>
<li>可根据自身实际使用场景中,针对误识别、漏识别的容忍程度,来调整使用不同阈值灵活应用。例如:对误识别容忍较低的应用场景下,人体框的得分阈值可以提到0.06及以上。</li>
</ul>
<h3>正确返回样例</h3>
<pre><code class="language-json">{
&quot;code&quot;: 200,// 返回码,详见返回码说明
&quot;msg&quot;: &quot;成功&quot;,// 返回码对应描述
&quot;taskNo&quot;: &quot;082246897222505513537185&quot;,// 本次请求号
&quot;charge&quot;: true,// 计费标志
&quot;data&quot;: {
&quot;person_num&quot;: &quot;1&quot;,//人体数目
&quot;person_info&quot;: [ //人体姿态信息
{
&quot;body_parts&quot;: { //身体部位信息,包含21个关键点
&quot;nose&quot;: { //头顶
&quot;score&quot;: 0.8942159414291382, //概率分数
&quot;x&quot;: 503.8671875, //x坐标
&quot;y&quot;: 330.6640625 //y坐标
},
&quot;right_knee&quot;: { //右膝
&quot;score&quot;: 0.2961595356464386,//概率分数
&quot;x&quot;: 445.7421875,//x坐标
&quot;y&quot;: 890.1171875 //y坐标
},
&quot;left_hip&quot;: { //左髋部
&quot;score&quot;: 0.5250594019889832,//概率分数
&quot;x&quot;: 561.9921875,//x坐标
&quot;y&quot;: 781.1328125 //y坐标
},
&quot;right_ankle&quot;: { //右脚踝
&quot;score&quot;: 0.2590301632881165,//概率分数
&quot;x&quot;: 431.2109375, //x坐标
&quot;y&quot;: 853.7890625 //y坐标
},
&quot;right_wrist&quot;: { //右手腕
&quot;score&quot;: 0.9074253439903259,//概率分数
&quot;x&quot;: 482.0703125,//x坐标
&quot;y&quot;: 432.3828125 //y坐标
},
&quot;left_eye&quot;: { //左眼
&quot;score&quot;: 0.8951929211616516,//概率分数
&quot;x&quot;: 532.9296875,//x坐标
&quot;y&quot;: 301.6015625 //y坐标
},
&quot;left_mouth_corner&quot;: { //左嘴角
&quot;score&quot;: 0.8808014392852783,//概率分数
&quot;x&quot;: 532.9296875,//x坐标
&quot;y&quot;: 359.7265625 //y坐标
},
&quot;right_elbow&quot;: { //右手肘
&quot;score&quot;: 0.7785468697547913, //概率分数
&quot;x&quot;: 409.4140625,//x坐标
&quot;y&quot;: 592.2265625 //y坐标
},
&quot;left_knee&quot;: { //左膝
&quot;score&quot;: 0.3373354375362396,//概率分数
&quot;x&quot;: 554.7265625,//x坐标
&quot;y&quot;: 890.1171875 //y坐标
},
&quot;neck&quot;: { //颈部
&quot;score&quot;: 0.7848875522613525,//概率分数
&quot;x&quot;: 532.9296875, //x坐标
&quot;y&quot;: 388.7890625 //y坐标
},
&quot;top_head&quot;: { //头顶
&quot;score&quot;: 0.8500685095787048,//概率分数
&quot;x&quot;: 518.3984375, //x坐标
&quot;y&quot;: 207.1484375 //y坐标
},
&quot;right_ear&quot;: { //右耳
&quot;score&quot;: 0.8363958597183228, //概率分数
&quot;x&quot;: 467.5390625,//x坐标
&quot;y&quot;: 308.8671875 //y坐标
},
&quot;left_ear&quot;: { //左耳
&quot;score&quot;: 0.9147939682006836, //概率分数
&quot;x&quot;: 576.5234375, //x坐标
&quot;y&quot;: 301.6015625 //y坐标
},
&quot;left_elbow&quot;: { 左手肘
&quot;score&quot;: 0.8399760723114014, //概率分数
&quot;x&quot;: 583.7890625, //x坐标
&quot;y&quot;: 628.5546875 //y坐标
},
&quot;right_shoulder&quot;: { //右肩
&quot;score&quot;: 0.8697558045387268, //概率分数
&quot;x&quot;: 438.4765625, //x坐标
&quot;y&quot;: 410.5859375 //y坐标
},
&quot;right_eye&quot;: { //右眼
&quot;score&quot;: 0.881825864315033,//概率分数
&quot;x&quot;: 482.0703125, //x坐标
&quot;y&quot;: 301.6015625 //y坐标
},
&quot;right_mouth_corner&quot;: { //右嘴角
&quot;score&quot;: 0.904476523399353, //概率分数
&quot;x&quot;: 496.6015625, //x坐标
&quot;y&quot;: 352.4609375 //y坐标
},
&quot;left_ankle&quot;: { //左脚踝
&quot;score&quot;: 0.2503626644611359,//概率分数
&quot;x&quot;: 583.7890625, //x坐标
&quot;y&quot;: 861.0546875 //y坐标
},
&quot;right_hip&quot;: { //右髋部
&quot;score&quot;: 0.5060766935348511,//概率分数
&quot;x&quot;: 453.0078125, //x坐标
&quot;y&quot;: 781.1328125 //y坐标
},
&quot;left_wrist&quot;: { //左手腕
&quot;score&quot;: 0.7268951535224915,//概率分数
&quot;x&quot;: 423.9453125,//x坐标
&quot;y&quot;: 621.2890625 //y坐标
},
&quot;left_shoulder&quot;: { //左肩
&quot;score&quot;: 0.85484778881073,//概率分数
&quot;x&quot;: 634.6484375,//x坐标
&quot;y&quot;: 432.3828125 //y坐标
}
},
&quot;location&quot;: {
&quot;height&quot;: 670.80139160156,//人体区域的高度
&quot;width&quot;: 524.25476074219,//人体区域的宽度
&quot;top&quot;: 241.42504882812,//人体区域离上边界的距离
&quot;score&quot;: 0.98725789785385,//人体框的概率分数,取值0-1,得分越接近1表示识别准确的概率越大
&quot;left&quot;: 902.15216064453//人体区域离左边界的距离
}
}
]
}
}</code></pre>
<h3>错误返回样例</h3>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;人体图像不能为空&quot;,
&quot;code&quot;: 400
}</code></pre>
<h3>返回字段说明</h3>
<table>
<thead>
<tr>
<th>字段名</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>返回码,详见code返回码说明</td>
</tr>
<tr>
<td>msg</td>
<td>code对应的描述</td>
</tr>
<tr>
<td>charge</td>
<td>是否计费</td>
</tr>
<tr>
<td>taskNo</td>
<td>本次请求号</td>
</tr>
<tr>
<td>data</td>
<td>返回具体结果,object类型,详见成功返回体</td>
</tr>
</tbody>
</table>
<h3>code返回码说明</h3>
<table>
<thead>
<tr>
<th>code</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>成功 (计费)</td>
</tr>
<tr>
<td>400</td>
<td>参数错误</td>
</tr>
<tr>
<td>404</td>
<td>接口地址不正确</td>
</tr>
<tr>
<td>500</td>
<td>系统维护,请稍候再试</td>
</tr>
<tr>
<td>601</td>
<td>接口未开通</td>
</tr>
<tr>
<td>602</td>
<td>账号停用</td>
</tr>
<tr>
<td>603</td>
<td>余额不足请充值</td>
</tr>
<tr>
<td>604</td>
<td>接口停用</td>
</tr>
<tr>
<td>606</td>
<td>调用超限,请稍候再试</td>
</tr>
<tr>
<td>607</td>
<td>ip不在白名单</td>
</tr>
<tr>
<td>609</td>
<td>请求过于频繁,请稍候再试</td>
</tr>
<tr>
<td>610</td>
<td>请求超时</td>
</tr>
<tr>
<td>999</td>
<td>其他,以实际返回为准</td>
</tr>
</tbody>
</table>