Ashraf
Ashraf

Reputation: 2632

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

I came across face.com APIs , i tried a simple PHP code to detect the face ...

i got the following response when i tried the 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>

The question is : how can i extract the face image ? i can see the face width is 18.75 and the height is 33.33 , but the full size is 844x450 , so how can i reflect these values to grab the face specially with the rotation values as well ? thank you

Upvotes: 0

Views: 803

Answers (1)

Dan Barak
Dan Barak

Reputation: 166

The return values are in percent as dev-null-dweller said.

Have a look at the face.com API Sandbox to see a visualization of the response.

Upvotes: 2

Related Questions