Facial Localization

facialLocalization(data, {[apiKey]: String, [privateCloud]: String, [sensitivity]: Float, [crop]: Boolean})
Returns a list of face bounding boxes found in a given image.
Available for version 0.8 and later.

Current Version: 1

Arguments

data – refer to img format guide – required
[apiKey] – String – optional – your indico API key
[privateCloud] – String – optional – your private cloud subdomain
[v or version] – Integer – optional (defaults to 1) – specify model version
[sensitivity] – Float (defaults to .8) – optional – The certainty threshold (between 0 and 1) the model uses to decide what to return as a face
[crop] – Boolean (defaults to False) – optional – If set to True, output is a list of cropped face images, each represented by a two dimensional array of integer pixel values

Output

This function will return a list of dictionaries that map from “top_left_corner” and “bottom_right_corner” to pixel coordinate pairs. Each mapping uniquely identifies a facial bounding box. The origin (0, 0) is assumed to be upper left corner. If the `crop` flag is set to True, output will instead be a list of the two dimensional pixel arrays of those images.

# single output
{
    'top_left_corner': (10, 24),
    'bottom_right_corner': : (87, 96),
}

# batch output
[
    {
        'top_left_corner': (10, 24),
        'bottom_right_corner': : (87, 96),
    }, 
    {
        'top_left_corner': (10, 24),
        'bottom_right_corner': : (87, 96),
    }
]

Example

var indico = require('indico.io');
indico.apiKey =  'YOUR_API_KEY';

var response = function(res) { console.log(res); }
var logError = function(err) { console.log(err); }
  
// single example
indico.facialLocalization("<IMAGE>")
  .then(response)
  .catch(logError);

// batch example
var batchInput = [
    "<IMAGE>",
    "<IMAGE>"
];
indico.facialLocalization(batchInput)
  .then(response)
  .catch(logError);