Face Detection

_images/face_detection.png

Find the areas that a matches a human face. Returns x,y,w,h

Example Go to our flickr photostream http://www.flickr.com/photos/112645524@N07/

Face Detection Example

Query Image http://farm3.staticflickr.com/2840/11587859065_6e90421557_o.jpg

_images/query_image_face.png

Response Image

_images/face_det_resp.png
POST /services/face_detect

Replies face/set of objects with its predictions.

Parameters:
  • instance_token – generated token.
Form Parameters:
 
  • query_url / query – query url link or query file.
  • feature_type – NONE.
Request Headers:
 
  • Accept – the response content type is “application/json”
  • InstanceToken – token to authenticate (optional if param instance_token is present)
Response Headers:
 
  • Content-Type – success content type is “application/json”
Status Codes:
  • 200 – success responce
  • 400 – when form parameters are missing
  • 401 – when param instance_token or header InstanceToken is not present present

Feature Detection Example

Query Image http://farm3.staticflickr.com/2878/11621234235_b2a6b1e381_o.jpg

_images/query_image_face_2.png

Response Image

_images/face_det_resp_2.jpg
POST /services/face_detect

Replies face/set of objects with its predictions.

Parameters:
  • instance_token – generated token.
Form Parameters:
 
  • query_url / query – query url link or query file.
  • feature_type – FACIAL_FEATURES.
Request Headers:
 
  • Accept – the response content type is “application/json”
  • InstanceToken – token to authenticate (optional if param instance_token is present)
Response Headers:
 
  • Content-Type – success content type is “application/json”
Status Codes:
  • 200 – success responce
  • 400 – when form parameters are missing
  • 401 – when param instance_token or header InstanceToken is not present present

Emotion Detection Example

Query Image http://farm3.staticflickr.com/2840/11587859065_6e90421557_o.jpg

_images/emo_det_req.png
_images/query_image_face.png

Response Image

_images/emo_det_resp.png
POST /services/face_detect

Replies face/set of objects with its predictions.

Parameters:
  • instance_token – generated token.
Form Parameters:
 
  • query_url / query – query url link or query file.
  • feature_type – EMOTION_DETECTION.
Request Headers:
 
  • Accept – the response content type is “application/json”
  • InstanceToken – token to authenticate (optional if param instance_token is present)
Response Headers:
 
  • Content-Type – success content type is “application/json”
Status Codes:
  • 200 – success responce
  • 400 – when form parameters are missing
  • 401 – when param instance_token or header InstanceToken is not present present

Gender Detection Example

Query Image http://farm3.staticflickr.com/2840/11587859065_6e90421557_o.jpg

_images/gender_det_req.png
_images/query_image_face.png

Response Image

_images/gender_det_resp.png
POST /services/face_detect

Replies face/set of objects with its predictions.

Parameters:
  • instance_token – generated token.
Form Parameters:
 
  • query_url / query – query url link or query file.
  • feature_type – GENDER_DETECTION.
Request Headers:
 
  • Accept – the response content type is “application/json”
  • InstanceToken – token to authenticate (optional if param instance_token is present)
Response Headers:
 
  • Content-Type – success content type is “application/json”
Status Codes:
  • 200 – success responce
  • 400 – when form parameters are missing
  • 401 – when param instance_token or header InstanceToken is not present present

Example in Python

import requests
import json
url='http://api.pixuate.com/rest/v1/services/face_detect'
headers={'InstanceToken' : 'YOUR TOKEN','Accept':'application/json'}
data={"query_url":"http://farm3.staticflickr.com/2840/11587859065_6e90421557_o.jpg","feature_type":"NONE"}
response=requests.post(url=url,data=data,headers=headers)
print response.content

Example in Java

public class pixuate extends AsyncTask<Void,Void,Void>
{

        @Override
        protected Void doInBackground(Void... params) {

        try
        {
        String url="http://api.pixuate.com/rest/v1/services/face_detect";
        HttpPost post=new HttpPost(url);
        HttpClient client=new DefaultHttpClient();
        List<BasicNameValuePair> nameValuePairs = new ArrayList<BasicNameValuePair>();
        nameValuePairs.add(new BasicNameValuePair("query_url"," http://farm3.staticflickr.com/2840/11587859065_6e90421557_o.jpg"));
        nameValuePairs.add(new BasicNameValuePair("feature_type","NONE"));
        post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        post.setHeader("Accept","application/json");
        post.setHeader("InstanceToken","YOUR TOKEN");
        HttpResponse http_response=client.execute(post);
        HttpEntity en=http_response.getEntity();
        String s=EntityUtils.toString(en);
        System.out.println(s);
        }catch (ClientProtocolException e) {

        } catch (IOException e) {
        // TODO Auto-generated catch block
        }
                return null;
        }

}