Facial Localization

POST https://apiv2.indico.io/faciallocalization/[batch]
Returns a list of face bounding boxes found in a given image.
Available for version 0.8 and later.

Current Version: 1

Private cloud endpoint

POST https://[cloud].indico.domains/faciallocalization/[batch]/

Arguments

data – refer to img format guide – required
[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

For an example of how to pass keyword arguments to the indico API in a post request, see the example below.

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

// Single Example
fetch('https://apiv2.indico.io/faciallocalization', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: '<IMAGE>',
    sensitivity: 0.8
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));

// Batch Example
fetch('https://apiv2.indico.io/faciallocalization/batch', {
  method: 'POST',
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    data: [
      '<IMAGE>',
      '<IMAGE>'
    ],
    sensitivity: 0.8
  })
})
  .then(r => r.json())
  .then(response => {
    console.log(response);
  })
  .catch(err => console.log(err));