Face Detection on Video

Face Detect is a robust analytic for detecting faces in video frames. Results are available as an annotated video for operator review or as coordinates to feed into other algorithms.

Using Face Detect

To use this service you have to upload a video 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 speed of the final results depends on the input resolution of the video and its number of frames.

The final results include a downloadable XML file which details the exact location and frame of each face detected in the original video. The results also contain a link to an annotated video 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
max_frames Do this many frames of the video Minimum 0 (do all)
blur Blur the detected faces 0 or 1

Request a Face Detect

Request a face detection on the supplied video file.

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

Example request for face-detect on Video:

$ curl -L -H "Authorization: Basic XXXX" -F video=@somevideo.avi  http://api.videoai.net/face_detect

Example response:

HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 217
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Mon, 14 Sep 2015 14:23:31 GMT
{
  "status": "success",
  "task": {
    "analytic": "face_detect",
    "complete": false,
    "job_id": "RawxCA5BhgDgu9GRJmxdbZ",
    "message": "In progress.",
    "start_time": "Mon, 14 Sep 2015 14:23:30 GMT"
  }
}

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/RawxCA5BhgDgu9GRJmxdbZ

Example response:

HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 723
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Mon, 14 Sep 2015 14:24:08 GMT
{
  "status": "success",
  "task": {
    "analytic": "face_detect",
    "complete": true,
    "finish_time": "Mon, 14 Sep 2015 14:24:08 GMT",
    "frames": 150,
    "frames_processed": 150,
    "input_video": "tracking.mov",
    "job_id": "RawxCA5BhgDgu9GRJmxdbZ",
    "message": "Face detector found 222 faces",
    "number_of_faces": 222,
    "resolution": "1920x1080@5.0fps",
    "results_video": "https://api.videoai.net/results/257/RawxCA5BhgDgu9GRJmxdbZ/face_detect_RawxCA5BhgDgu9GRJmxdbZ.avi",
    "results_xml": "https://api.videoai.net/results/257/RawxCA5BhgDgu9GRJmxdbZ/face_detect_RawxCA5BhgDgu9GRJmxdbZ.xml",
    "start_frame": 0,
    "start_time": "Mon, 14 Sep 2015 14:23:30 GMT",
    "success": true
  }
}

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: 15458
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Mon, 14 Sep 2015 13:58:59 GMT
{
  "status": "success",
  "tasks": [
    {
      "analytic": "face_detect",
      "complete": false,
      "job_id": "5XxwmXR8PvmNcxubWAm6VG",
      "message": "In progress.",
      "start_time": "Mon, 14 Sep 2015 13:58:40 GMT"
    },
    {
      "analytic": "face_detect",
      "complete": true,
      "finish_time": "Mon, 14 Sep 2015 13:58:39 GMT",
      "frames": 180,
      "frames_processed": 178,
      "input_video": "BarisTrack.avi",
      "job_id": "s73TMNkPaXBT9BsjZf5Ja9",
      "message": "Face detector found 0 faces",
      "number_of_faces": 0,
      "resolution": "1280x720@10.0fps",
      "results_video": "https://api.videoai.net/results/257/s73TMNkPaXBT9BsjZf5Ja9/face_detect_s73TMNkPaXBT9BsjZf5Ja9.avi",
      "results_xml": "https://api.videoai.net/results/257/s73TMNkPaXBT9BsjZf5Ja9/face_detect_s73TMNkPaXBT9BsjZf5Ja9.xml",
      "start_frame": 0,
      "start_time": "Mon, 14 Sep 2015 13:58:28 GMT",
      "success": true
    },
    {
      "analytic": "face_detect",
      "complete": true,
      "finish_time": "Mon, 14 Sep 2015 13:57:39 GMT",
      "frames": 160,
      "frames_processed": 160,
      "input_video": "Office.avi",
      "job_id": "FDK8vpJBT4x324KiK44JYX",
      "message": "Face detector found 15 faces",
      "number_of_faces": 15,
      "resolution": "1024x768@8.0fps",
      "results_video": "https://api.videoai.net/results/257/FDK8vpJBT4x324KiK44JYX/face_detect_FDK8vpJBT4x324KiK44JYX.avi",
      "results_xml": "https://api.videoai.net/results/257/FDK8vpJBT4x324KiK44JYX/face_detect_FDK8vpJBT4x324KiK44JYX.xml",
      "start_frame": 0,
      "start_time": "Mon, 14 Sep 2015 13:57:25 GMT",
      "success": true
    }, ....
   ]
}