Person Detection

The Person Detection API allows you to detect faces and people in images.

Endpoints

The service provides two endpoints:

https://api.ximilar.com/identity/v2/face      (for detecting faces)
https://api.ximilar.com/identity/v2/person    (for detecting people)

POST/v2/face

Face Detection

Quickstart

Given a list of image records, this method detects all faces in the images. For each face, it returns a bounding box and a confidence score.

Required attributes

  • Name
    records
    Type
    dict
    Max
    Maximum:10
    Description

    A batch of JSON records (max 10). Each record represents a single image, defined by _url or _base64.

Returns

HTTP error code 2XX, if the method was OK, and other HTTP error code, if the method failed. The response body is a JSON object (map) with the following fields:

  • Name
    records
    Type
    dict
    Description

    JSON array with the input records, each record enriched by field _objects containing detected faces with bounding boxes and probabilities.

  • Name
    status
    Type
    dict
    Description

    A JSON map/dictionary with a status of the method processing. It contains these subfields: code (numeric code of the operation status; it follows the concept of HTTP status codes) and text (text describing the status code).

Request

POST
/v2/face
curl https://api.ximilar.com/identity/v2/face -H "Content-Type: application/json" -H "Authorization: Token __API_TOKEN__" -d '{
  "records": [
    {
      "_url": "__PATH_TO_IMAGE_URL__"
    }
  ]
}'

Response

{
  "records": [
    {
      "_url": "__SOME_URL__",
      "_status": {
        "code": 200,
        "text": "OK"
      },
      "_width": 2736,
      "_height": 3648,
      "_objects": [
        {
          "name": "face",
          "bound_box": [
            2103,
            467,
            2694,
            883
          ],
          "prob": 0.9890862107276917
        },
        {
          "name": "face",
          "bound_box": [
            100,
            100,
            500,
            883
          ],
          "prob": 0.9890862107276917
        }
      ]
    }
  ]
}

POST/v2/person

Person Detection

Quickstart

Given a list of image records, this method returns detected people in the images. For each image it predicts positions of people with bounding boxes and confidence scores.

Required attributes

  • Name
    records
    Type
    dict
    Max
    Maximum:10
    Description

    A batch of JSON records (max 10). Each record represents a single image, defined by _url or _base64.

Returns

HTTP error code 2XX, if the method was OK, and other HTTP error code, if the method failed. The response body is a JSON object (map) with the following fields:

  • Name
    records
    Type
    dict
    Description

    JSON array with the input records, each record enriched by field _objects containing detected people with bounding boxes and probabilities.

  • Name
    status
    Type
    dict
    Description

    A JSON map/dictionary with a status of the method processing. It contains these subfields: code (numeric code of the operation status; it follows the concept of HTTP status codes) and text (text describing the status code).

Request

POST
/v2/person
curl https://api.ximilar.com/identity/v2/person -H "Content-Type: application/json" -H "Authorization: Token __API_TOKEN__" -d '{
  "records": [
    {
      "_url": "__PATH_TO_IMAGE_URL__"
    }
  ]
}'

Response

{
  "records": [
    {
      "_url": "__SOME_URL__",
      "_status": {
        "code": 200,
        "text": "OK"
      },
      "_width": 2736,
      "_height": 3648,
      "_objects": [
        {
          "name": "person",
          "bound_box": [
            2103,
            467,
            2694,
            883
          ],
          "prob": 0.9890862107276917
        },
        {
          "name": "person",
          "bound_box": [
            100,
            100,
            500,
            883
          ],
          "prob": 0.9890862107276917
        }
      ]
    }
  ]
}

Was this page helpful?