Face Arousal Valence

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

Methods

  • EnxFaceAI.startFaceArousalValence(config, callback): To start analyzing the face arousal valence in a video stream.
  • EnxFaceAI.stopFaceArousalValence(callback): To stop analyzing face arousal valence in a video stream.

Parameters

For Method: EnxFaceAI.startFaceArousalValence(config, callback)

  • config : JSON Object. This is to configure or customize parameter using which the Face Arousal Valence would be analyzed.
    • smoothness : Number. Default 0.70. 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.stopFaceArousalValence(callback)

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

Event Listener

  • face-arousal-valence: This event notification is received repeatedly with the Face Arousal Valence report as a JSON object.

JSON Object: Received with Face Arousal Valence Analysis data.

{ output: {
arousalvalence: {
arousal: Number,
valence: Number
}
}
}

Analysis Data Explanation

  • output : Face Arousal Valence Report
    • arousalvalence : Filtered (smoothened) values.
      • arousal : Range 1.0 to 1.0. It represents the degree of engagement (positive arousal), or disengagement (negative arousal).
      • valence : Range -1.0 to 1.0. It represents the degree of pleasantness (positive valence), or unpleasantness (negative valence).

Sample Code

config = {
smoothness: 0.70
};
// Start Face Arousal Valence
faceAI.startFaceArousalValence(config, (res) => {
if (res.result === 0) {
window.addEventListener("face-arousal-valence", (evt) => {
console.log(evt.detail, "face-arousal-valence");
});
}
});
// Stop Face Arousal Valence
faceAI.stopFaceArousalValence((res) => {
if (res.result === 0) { }
});