Face Age

Analyzes and predicts the age of a face in a video stream. The face age is predicted within an age range. The event listener continuously obtains the data in a JSON object as FaceAI analyzes the age of a face. If the prediction quality is poor, the event is not issued.


To start or stop analyzing the age of a face.

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


  • enable : Boolean. Set it to true to enable or start analyzing the age of a face. Otherwise, set it to false.

Callback Method

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

JSON Object: Received with Face Age Analysis data.

{ output: {
age: {
-18: Number,
18-35: Number,
35-51: Number,
51-: Number
numericAge: Number

Analysis Data Explanation

  • output : Face Age Analysis Report
    • age : Filtered (smoothened) age prediction:
      • -18 : Probability Weightage suggesting less than 18 years old.
      • 18-35 : Probability Weightage suggesting between 18 to 35 years old.
      • 35-51 : Probability Weightage suggesting between 18 35 years old.
      • 51- : Probability Weightage suggesting equal or greater than 51 years old.
    • numericAge : Numeric. Estimated Age

Note: In case of poor quality of the prediction, the event is not fired (that is, it is skipped for the specified frame).

Sample Code

enxFaceAI.enableFaceAge(true); // To start analysis
enxFaceAI.enableFaceAge(false); // To stop analysis
// Callback
public void onFaceAgeData(String type, String value) {