Now with direction parameter

Facekit.net now supports parametric estimation of face direction as it’s default feature. Following is the new JSON output format:

  1.  
  2. {
  3.   state: "detected",  // Detection result "detected" or "none"
  4.   label: "front",  // Recognition result
  5.   x:40, y:50,  // Detected position
  6.   xdir: 10,     // Direction parameter (-90 to 90)
  7.   width:20, height:20,  // Size of the detected face
  8.   time:100.0  // Timestamp (only when the input type is flv)
  9. }

Use of javascript is completely compatible with the previous examples:

  1.  
  2. function getResult(value) {
  3.     var data = eval("("+value+")");
  4.     if (data.xdir < -20) {
  5.         do_something…
  6.     } else if (data.xdir > 20) {
  7.         do_something_else…
  8.     }
  9. }

For any feedback, please let me know by writing a comment on this blog.

Leave a Reply