Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
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.
HUAWEI HMS Core
Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.
| 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 |
| Return type | Method name |
| int | getAge() |
| float | getHatProbability() |
| float | getLeftEyeOpenProbability() |
| float | getMoustacheProbability() |
| float | getRightEyeOpenProbability() |
| float | getSexProbability() |
| float | getSunGlassProbability() |
| String | toString() |
| Method |
| public int getAge() |
| Obtains the age of a face. |
Return
| Type | desc |
| int | Returns 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
| Type | desc |
| float | Returns 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
| Type | desc |
| float | Returns 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
| Type | desc |
| float | Returns 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
| Type | desc |
| float | Returns 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
| Type | desc |
| float | Returns 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
| Type | desc |
| float | Returns 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
| Type | desc |
| String | Character string of the current instance. |
Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Quick start
Helps you find desired resources with ease.