Person Detection
This page describes API for Person Detection service which provides face and person detection capabilities on images. The API follows the general rules of Ximilar API as described in Section First steps.
Endpoints
This service API has two endpoints running at URLs:
https://api.ximilar.com/identity/v2/face (for face detection)
https://api.ximilar.com/identity/v2/person (for person detection)
Face Detection
Given a list of image records, this method returns detected faces in the images. For each image it predicts positions of faces with bounding boxes and confidence scores.
Required attributes
- Name
records
- Type
- dict
- Description
A batch of json records (max 10), one record is representation of an image and it's defined by
_url
,_file
or_base64
.
Returns
HTTP error code 2XX, if the method was OK and other HTTP error code, if the method failed. Body of the response 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) andtext
(text describing the status code).
Request
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
}
]
}
]
}
Person Detection
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
- Description
A batch of json records (max 10), one record is representation of an image and it's defined by
_url
,_file
or_base64
.
Returns
HTTP error code 2XX, if the method was OK and other HTTP error code, if the method failed. Body of the response 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) andtext
(text describing the status code).
Request
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
}
]
}
]
}