目录

class info
com.huawei.hms.mlsdk.face.MLFaceAnalyzerSetting
Represents the face analysis configurator, which sets the attributes of the face analyzer. The face analyzer attributes include:
1. Whether to detect facial key-points
2. Whether to detect facial shapes

3. Whether to detect facial expressions and features, such as smiling and wearing a hat

4. Speed/precision preference mode for the analyzer to choose precision or speed priority in performing face detection

5. Whether to enable the face tracking function

6. Smallest proportion of a face in an image

7. Whether to detect only the largest face

Constant Summary

TypeNameDesc
intTYPE_FEATURESDetect facial features and expressions in addition to basic data.
intTYPE_KEYPOINTSDetects facial key-points.
intTYPE_PRECISIONPrecision preference mode. This mode will detect more faces and be more precise in detecting key points and shapes, but will run slower.
intTYPE_SHAPESDetects facial shapes.
intTYPE_SPEEDSpeed preference mode. Compared with the precision preference mode, this mode will detect fewer faces and be less precise in detecting key points and shapes, but will run faster.
intTYPE_UNSUPPORT_FEATURESDetects only basic data: including shapes, key points, and three-dimensional rotation angles; does not detect facial features or expressions.
intTYPE_UNSUPPORT_KEYPOINTSDoes not detect facial key-points.
intTYPE_UNSUPPORT_SHAPESDoes not detect facial shapes.

Public Method Summary

Return typeMethod name
booleanequals(Object object)
intgetFeatureType()
intgetKeyPointType()
floatgetMinFaceProportion()
intgetPerformanceType()
intgetShapeType()
inthashCode()
booleanisMaxSizeFaceOnly()
booleanisTracingAllowed()
StringtoString()

Constants

Constant
public static final int TYPE_FEATURES
Detect facial features and expressions in addition to basic data.
Constant value: 1
Constant
public static final int TYPE_KEYPOINTS
Detects facial key-points.
Constant value: 1
Constant
public static final int TYPE_PRECISION
Precision preference mode. This mode will detect more
faces and be more precise in detecting key points and shapes,
but will run slower.
Constant value: 1
Constant
public static final int TYPE_SHAPES
Detects facial shapes.
Constant value: 2
Constant
public static final int TYPE_SPEED
Speed preference mode. This mode will detect fewer faces and be less precise in detecting key points and shapes, but will run faster.
Constant value: 2
Constant
public static final int TYPE_UNSUPPORT_FEATURES
Detects only basic data: including shapes, key points, and three-dimensional rotation angles; does not detect facial features or expressions.
Constant value: 2
Constant
public static final int TYPE_UNSUPPORT_KEYPOINTS
Does not detect facial key points.
Constant value: 0
Constant
public static final int TYPE_UNSUPPORT_SHAPES
Does not detect facial shapes.
Constant value: 3

Public Methods

Method
public boolean equals(Object object)
Determines whether the input instance is equal to the current instance.

Parameters

Parameter nameParameter desc
objectInstance to be compared.


Return

Typedesc
booleantrue: The instances are equal.
false: The instances are not equal.
Method
public int getFeatureType()
Obtains the detection mode of facial features and expressions of the analyzer.

Return

Typedesc
intReturns the detection mode of facial features and expressions of the analyzer. The default value is 1 (TYPE_FEATURES), indicating that facial features and expressions are detected.
Method
public int getKeyPointType()
Obtains the facial key-point detection mode of the analyzer.

Return

Typedesc
intReturns the facial key-point detection mode of the analyzer. The default value is 1 (TYPE_KEYPOINTS), indicating that facial key-points are detected.
Method
public float getMinFaceProportion()
Obtains the smallest proportion of a face in an image. The proportion is equal to the head width divided by the image width.

Return

Typedesc
floatReturns the smallest face proportion set by the user. The default value is 0.1.
Method
public int getPerformanceType()
Obtains the preference mode of the analyzer.

Return

Typedesc
intReturns the preference mode of the analyzer. The default value is 1 (TYPE_PRECISION), representing a preference for precision.
Method
public int getShapeType()
Obtains the facial shape detection mode of the analyzer.

Return

Typedesc
intReturns the facial shape detection mode of the analyzer. The default value is 2 (TYPE_SHAPES), indicating that facial shapes are detected.
Method
public int hashCode()
Obtains the hash value of the current instance.

Return

Typedesc
intHash value of the instance.
Method
public boolean isMaxSizeFaceOnly()
Indicates whether to detect only the largest face in an image.

Return

Typedesc
booleanIndicates whether to detect only the largest face. The default value is false, indicating that all faces are detected.
Method
public boolean isTracingAllowed()
Indicates whether to enable face tracking.

Return

Typedesc
booleanIndicates whether to enable face tracking. The default value is false, indicating that face tracking is disabled.
Method
public String toString()
Converts the current instance into a character string.

Return

Typedesc
StringCharacter string of the current instance.