目录

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

Return typeMethod name
floatgetAngryProbability()
floatgetDisgustProbability()
floatgetFearProbability()
floatgetNeutralProbability()
floatgetSadProbability()
floatgetSmilingProbability()
floatgetSurpriseProbability()
StringtoString()

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.