Facial Localization

facialLocalization.predict(data, [params])
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
[api_key] – String – optional – your indico API key
[cloud] – 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

import io.indico.Indico;
import io.indico.api.IndicoResult;
import io.indico.api.BatchIndicoResult;

// single example
Indico indico = new Indico("YOUR_API_KEY");
IndicoResult single = indico.facialLocalization.predict(
    "<IMAGE>"
);
Double result = single.getFacialLocalization();
System.out.println(result);

// batch example
String[] example = {
    "<IMAGE>", 
    "<IMAGE>"
};
BatchIndicoResult multiple = indico.facialLocalization.predict(example);
List results = multiple.getFacialLocalization();
System.out.println(results);