Face Features

Analyzes the features of a face in a video stream. The event listener continuously gets the data in a JSON object as FaceAI analyzes the face features.

Methods

  • EnxFaceAI.startFaceFeatures(config, callback) : To start analyzing face features in a video stream.
  • EnxFaceAI.stopFaceFeatures(callback) : To stop analyzing face features in a video stream.

Parameters

For Method: EnxFaceAI.startFaceFeatures(config, callback)

  • config : JSON Object. This is to configure or customize parameter using which the Face Features would be analyzed.
    • smoothness : Number. Default 0.90. Range 0-1. Value closer to 1 provides greater smoothing and slower response time. Lower values provide lesser smoothing but faster response time. Set it to 0 (zero) if you need the raw signal.
  • callback : Callback to know that processing request has been accepted.

For Method: EnxFaceAI.stopFaceFeatures(callback)

  • callback : Callback to know that request has been accepted.

Event Listener

  • face-features: This event notification is received repeatedly with the Face Features Analysis report as a JSON object.

JSON Object: Received with Face Features Analysis data.

{ output: {
features: {
ArchedEyebrows: Number,
Attractive: Number,
....
....
}
}
}

Analysis Data Explanation

  • output: Face Features Report
    • features: Filtered (smoothened) probabilities of each face independent feature in range 0.0 – 1.0. The following features are evaluated:
      • Arched Eyebrows
      • Attractive
      • Bags Under Eyes
      • Bald
      • Bangs
      • Beard 5 O’Clock Shadow
      • Big Lips
      • Big Nose
      • Black Hair
      • Blond Hair
      • Brown Hair
      • Chubby
      • Double Chin
      • Earrings
      • Eyebrows Bushy
      • Eyeglasses
      • Goatee
      • Gray Hair
      • Hat
      • Heavy Makeup
      • High Cheekbones
      • Lipstick
      • Mouth Slightly Open
      • Mustache
      • Narrow Eyes
      • Necklace
      • Necktie
      • No Beard
      • Oval Face
      • Pale Skin
      • Pointy Nose
      • Receding Hairline
      • Rosy Cheeks
      • Sideburns
      • Straight Hair
      • Wavy Hair

Sample Code

config = {
smoothness: 0.90
};
// Start Face Features
faceAI.startFaceFeatures(config, (res) => {
if (res.result === 0) {
window.addEventListener("face-features", (evt) => {
console.log(evt.detail, "face-features");
});
}
});
// Stop Face Features
faceAI.stopFaceFeatures((res) => {
if (res.result === 0) { }
});