Face Attention

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

Method

To start or stop analyzing Face Attention in a video stream.

  • Class: EnxFaceAI
  • Method: public void enableFaceAttention(boolean enable)

Parameter

  • enable : Boolean. Set it to true to enable or start the analysis of face attention. Otherwise, set it to false.

Callback Method

  • onFaceAttentionData : This method is received repeatedly with the Face Attention Analysis report as a JSON object.

JSON Object: Received with Face Attention Analysis data.

{ output: {
attention: Number
}
}

Analysis Data Explanation

  • output : Face Attention Report
    • attention : Filtered value (smoothened) in range [0.0, 1.0]. A value close to 1.0 represents attention, a value close to 0.0 represents distraction

Sample Code

enxFaceAI.enableFaceAttention(true); // To start analysis
enxFaceAI.enableFaceAttention(false); // To stop analysis
// Callback
@Override
public void onFaceAttentionData(String type, String value) {
}