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.faceMLFaceEmotion

MLFaceEmotion

class info
com.huawei.hms.mlsdk.face.MLFaceEmotion
Represents a facial expression class. Seven facial expressions are included: smiling, neutral, anger, disgust, fear, sadness, and surprise. The sum of the measurements of all the facial expressions is 1.

Public Method Summary

Public Methods

Method
public float getAngryProbability()
Obtains the measurement of anger.

Return

Typedesc
floatReturns the measurement of anger, 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 anger is returned. Otherwise, –1 is returned.
Method
public float getDisgustProbability()
Obtains the measurement of disgust.

Return

Typedesc
floatReturns the measurement of disgust, 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 disgust is returned. Otherwise, –1 is returned.
Method
public float getFearProbability()
Obtains the measurement of fear.

Return

Typedesc
floatReturns the measurement of fear, 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 fear is returned. Otherwise, –1 is returned.
Method
public float getNeutralProbability()
Obtains the measurement of a neutral expression.

Return

Typedesc
floatReturns the measurement of a neutral expression, 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 a neutral expression is returned. Otherwise, –1 is returned.
Method
public float getSadProbability()
Obtains the measurement of sadness.

Return

Typedesc
floatReturns the measurement of sadness, 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 sadness is returned. Otherwise, –1 is returned.
Method
public float getSmilingProbability()
Obtains the measurement of smiling.

Return

Typedesc
floatReturns the measurement of smiling, 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 smiling is returned. Otherwise, –1 is returned.
Method
public float getSurpriseProbability()
Obtains the measurement of surprise.

Return

Typedesc
floatReturns the measurement of surprise, 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 surprise 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.