Face Detection on Images

Face Detect is a robust analytic for detecting faces in an image. Results are available as an annotated image for operator review or as a downloadable XML file which contains information of every face detected.

Using Face Detect

To use this service you have upload an image to the VideoAI.net server.

The face detector is capable of detecting faces down to approximately 30 pixels in width. The face detector will detect faces up to 30 degrees from frontal.

The final results include a downloadable XML file which details the exact location and frame of each face detected in the original image. The results also contain a link to an annotated image file which contains on overlay of each face detected.

The following table details the parameters that are available.

Parameter Description Values
min_size Minimum size of detected faces (pixels) Minimum 30
blur Blur the detected faces 0 or 1

Request a Face Detect

Request a face detection on the supplied image file.

POST /face_detect
POST /face_detect/ HTTP/1.1
Host: api.videoai.net
Authorization: Basic XXXXX

Example request for face-detect on an Image:

$ curl -L -H "Authorization: Basic XXXX" -F image=@someimage.jpg  http://api.videoai.net/face_detect

Example response:

HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 685
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Thu, 10 Sep 2015 14:59:20 GMT
{
  "status": "success",
  "task": {
    "analytic": "face_detect_image",
    "complete": true,
    "file_size": 330177,
    "finish_time": "Thu, 10 Sep 2015 14:59:19 GMT",
    "height": 1063,
    "input_image_file": "group.jpg",
    "job_id": "uhPJ8tbkpf67posoHC5TWT",
    "message": "Face detector found 16 faces",
    "number_of_faces": 16,
    "results_image": "http://192.168.90.53:5000/results/253/uhPJ8tbkpf67posoHC5TWT/face_detect_uhPJ8tbkpf67posoHC5TWT.jpg",
    "results_xml": "http://192.168.90.53:5000/results/253/uhPJ8tbkpf67posoHC5TWT/face_detect_uhPJ8tbkpf67posoHC5TWT.xml",
    "start_time": "Thu, 10 Sep 2015 14:59:19 GMT",
    "success": true,
    "width": 1600
  }
}

Check Job Status

Get the status of a face detection job.

GET /face_detect/(string: job_id)
GET /face_detect/(string:job_id) HTTP/1.1
Host: api.videoai.net
Authorization: Basic XXXXX

Example request:

$ curl -L -H "Authorization: Basic XXXX" http://api.videoai.net/face_detect/3fd4a9bb-7739-4860-a091-0b7f53839df5

Example response:

HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 222
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Thu, 10 Sep 2015 14:59:19 GMT
{
  "status": "success",
  "task": {
    "analytic": "face_detect_image",
    "complete": false,
    "job_id": "uhPJ8tbkpf67posoHC5TWT",
    "message": "In progress.",
    "start_time": "Thu, 10 Sep 2015 14:59:19 GMT"
  }
}

Job History

Get the status of the last 50 face detection jobs tasks submitted.

GET /face_detect
GET /face_detect HTTP/1.1
Host: api.videoai.net
Authorization: Basic XXXXX

Example request:

$ curl -L -H "Authorization: Basic XXXX" http://api.videoai.net/face_detect

Example response:

HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 28177
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Mon, 14 Sep 2015 14:03:09 GMT
{
  "status": "success",
  "tasks": [
    {
      "analytic": "face_detect_image",
      "complete": true,
      "file_size": 935788,
      "finish_time": "Fri, 11 Sep 2015 14:50:14 GMT",
      "height": 768,
      "input_image_file": "KaliningradFaces.jpg",
      "job_id": "Lap9mMMiS9yKdpQBtesDiU",
      "message": "Face detector found 37 faces",
      "number_of_faces": 37,
      "results_image": "https://api.videoai.net/results/254/Lap9mMMiS9yKdpQBtesDiU/face_detect_Lap9mMMiS9yKdpQBtesDiU.jpg",
      "results_xml": "https://api.videoai.net/results/254/Lap9mMMiS9yKdpQBtesDiU/face_detect_Lap9mMMiS9yKdpQBtesDiU.xml",
      "start_time": "Fri, 11 Sep 2015 14:50:13 GMT",
      "success": true,
      "width": 1024
    },
    {
      "analytic": "face_detect_image",
      "complete": true,
      "file_size": 935788,
      "finish_time": "Fri, 11 Sep 2015 14:49:54 GMT",
      "height": 768,
      "input_image_file": "KaliningradFaces.jpg",
      "job_id": "bKbS5JdJcBxZPE93duDhc9",
      "message": "Face detector found 43 faces",
      "number_of_faces": 43,
      "results_image": "https://api.videoai.net/results/254/bKbS5JdJcBxZPE93duDhc9/face_detect_bKbS5JdJcBxZPE93duDhc9.jpg",
      "results_xml": "https://api.videoai.net/results/254/bKbS5JdJcBxZPE93duDhc9/face_detect_bKbS5JdJcBxZPE93duDhc9.xml",
      "start_time": "Fri, 11 Sep 2015 14:49:54 GMT",
      "success": true,
      "width": 1024
    }, ...
  ]
}