We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.

HMS Core ReferencesML Kitmlsdk.faceMLFaceFeature

MLFaceFeature

class info
com.huawei.hms.mlsdk.face.MLFaceFeature
Represents a facial feature class. Seven facial features are included:
1. Measurement of opening the left eye
2. Measurement of opening the right eye
3. Measurement of wearing glasses
4. Gender measurement
5. Measurement of wearing a hat
6. Measurement of wearing a beard
7. Age

Public Method Summary

Public Methods

Method
public int getAge()
Obtains the age of a face.

Return

Typedesc
intReturns the age of a face. If facial feature and expression detection is enabled using the MLFaceAnalyzerSetting.Factory.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES) method, the age is returned. Otherwise, –1 is returned.
Method
public float getHatProbability()
Obtains the measurement of wearing a hat.

Return

Typedesc
floatReturns the measurement of wearing a hat, which is represented by a value ranging from 0.0 to 1.0. If facial feature and expression detection is enabled using the MLFaceAnalyzerSetting.Factory.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES) method, the measurement of wearing a hat is returned. Otherwise, –1 is returned.
Method
public float getLeftEyeOpenProbability()
Obtains the measurement of opening the left eye.

Return

Typedesc
floatReturns the measurement of opening the left eye, which is represented by a value ranging from 0.0 to 1.0. If facial feature and expression detection is enabled using the MLFaceAnalyzerSetting.Factory.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES) method, the measurement of opening the left eye is returned. Otherwise, –1 is returned.
Method
public float getMoustacheProbability()
Obtains the measurement of wearing a beard.

Return

Typedesc
floatReturns the measurement of wearing a beard, which is represented by a value ranging from 0.0 to 1.0. If facial feature and expression detection is enabled using the MLFaceAnalyzerSetting.Factory.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES) method, the measurement of wearing a beard is returned. Otherwise, –1 is returned.
Method
public float getRightEyeOpenProbability()
Obtains the measurement of opening the right eye.

Return

Typedesc
floatReturns the measurement of opening the right eye, which is represented by a value ranging from 0.0 to 1.0. If facial feature and expression detection is enabled using the MLFaceAnalyzerSetting.Factory.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES) method, the measurement of opening the right eye is returned. Otherwise, –1 is returned.
Method
public float getSexProbability()
Obtains the gender measurement of a face.

Return

Typedesc
floatReturns the gender measurement of a face, which is represented by a value ranging from 0.0 to 1.0. 0.0–0.5 indicates that the gender may be male, and 0.5–1.0 indicates that the gender may be female. If facial feature and expression detection is enabled using the MLFaceAnalyzerSetting.Factory.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES) method, the gender measurement is returned. Otherwise, –1 is returned.
Method
public float getSunGlassProbability()
Obtains the measurement of wearing glasses.

Return

Typedesc
floatReturns the measurement of wearing glasses, which is represented by a value ranging from 0.0 to 1.0. If facial feature and expression detection is enabled using the MLFaceAnalyzerSetting.Factory.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES) method, the measurement of wearing glasses is returned. Otherwise, –1 is returned.
Method
public String toString()
Converts the current instance into a character string.

Return

Typedesc
StringCharacter string of the current instance.
This page may contain third-party content. For details, click here.
Search in References
Enter a keyword.