face.com API,如何检测人脸,然后提取它


face.com API , How to detect the face and then extract it?

我遇到了face.com API,我尝试了一个简单的PHP代码来检测人脸。。。

当我尝试face.detect API时,我得到了以下响应:

<tag>
<tid>TEMP_F@e4d93bd72df703699dd84ea2f9d6b6de_e200f9aee59fb59a97a325e17f79edcc_74.38_53.56_0_0</tid>
<recognizable>1</recognizable>
<threshold></threshold>
<uids>
</uids>
<gid></gid>
<label></label>
<confirmed>0</confirmed>
<manual>0</manual>
<tagger_id></tagger_id>
<width>18.75</width>
<height>33.33</height>
<center>
    <x>74.38</x>
    <y>53.56</y>
</center>
<eye_left>
    <x>70.51</x>
    <y>45.42</y>
</eye_left>
<eye_right>
    <x>78.55</x>
    <y>45.88</y>
</eye_right>
<mouth_left>
    <x>70.35</x>
    <y>61.11</y>
</mouth_left>
<mouth_center>
    <x>73.95</x>
    <y>62.66</y>
</mouth_center>
<mouth_right>
    <x>78.09</x>
    <y>61.82</y>
</mouth_right>
<nose>
    <x>74.01</x>
    <y>55.01</y>
</nose>
<ear_left></ear_left>
<ear_right></ear_right>
<chin></chin>
<yaw>-1.46</yaw>
<roll>1.85</roll>
<pitch>1.73</pitch>
<attributes >
    <glasses>
        <value>false</value>
        <confidence>16</confidence>
    </glasses>
    <smiling>
        <value>true</value>
        <confidence>84</confidence>
    </smiling>
    <face>
        <value>true</value>
        <confidence>93</confidence>
    </face>
    <gender>
        <value>male</value>
        <confidence>24</confidence>
    </gender>
    <mood>
        <value>happy</value>
        <confidence>18</confidence>
    </mood>
    <lips>
        <value>parted</value>
        <confidence>64</confidence>
    </lips>
</attributes>
</tag>

问题是:如何提取人脸图像?我可以看到人脸的宽度是18.75,高度是33.33,但全尺寸是844x450,所以我如何反映这些值来捕捉人脸,特别是旋转值呢?感谢

返回值以百分比为单位,正如dev-null-dister所说。

查看face.com API沙盒,查看响应的可视化。

相关文章: