Face Gender
Analyzes the gender of a face in a video stream. The event listener continuously gets the data in a JSON object as FaceAI analyzes the face gender.
Method
To start or stop analyzing the gender of a face in a video stream.
- Class:
EnxFaceAI
- Method:
public void enableFaceGender(boolean enable)
Parameter
enable
: Boolean. Set it to true to enable or start the analysis of face gender. Otherwise, set it to false.
Callback Method
onFaceGenderData
: This method is received repeatedly with the Face Gender Analysis report as a JSON object.
JSON Object: Received with Face Gender Analysis data.
{ output: {gender: {Female: Number,Male: Number},mostConfident: String}}
Analysis Data Explanation
output
: Face Gender Reportgender
: Filtered (smoothened) probabilities of the gender prediction:Female
: Probability weightage for gender is femaleMale
: Probability weightage for gender is male
mostConfident
: Gender name of the most likely result if its smoothened probability is above the threshold, otherwise it is undefined.
Sample Code
enxFaceAI.enableFaceGender(true); // To start analysisenxFaceAI.enableFaceGender(false); // To stop analysis// Callback@Overridepublic void onFaceGenderData(String type, String value) {}