| class info |
| com.huawei.hms.mlsdk.face.MLFaceAnalyzerSetting.Factory |
| Creates an instance of the face analysis configurator (MLFaceAnalyzerSetting). |
| Return type | Method name |
| MLFaceAnalyzerSetting.Factory | allowTracing() |
| MLFaceAnalyzerSetting | create() |
| MLFaceAnalyzerSetting.Factory | setFeatureType(int featureType) |
| MLFaceAnalyzerSetting.Factory | setKeyPointType(int keyPointType) |
| MLFaceAnalyzerSetting.Factory | setMaxSizeFaceOnly(boolean isMaxSizeFaceOnly) |
| MLFaceAnalyzerSetting.Factory | setMinFaceProportion(float minFaceProportion) |
| MLFaceAnalyzerSetting.Factory | setPerformanceType(int performanceType) |
| MLFaceAnalyzerSetting.Factory | setShapeType(int shapeType) |
| MLFaceAnalyzerSetting.Factory | setTracingAllowed(boolean isTracingAllowed) |
| Method |
| public MLFaceAnalyzerSetting.Factory allowTracing() |
| Enables face tracking. |
Return
| Type | desc |
| MLFaceAnalyzerSetting.Factory | Returns the instance of MLFaceAnalyzerSetting.Factory. |
| Method |
| public MLFaceAnalyzerSetting create() |
| Creates an instance of the face analysis configurator (MLFaceAnalyzerSetting). |
Return
| Type | desc |
| MLFaceAnalyzerSetting | Returns the instance of MLFaceAnalyzerSetting. |
Sample Code
- MLFaceAnalyzerSetting setting = new MLFaceAnalyzerSetting.Factory()
- .setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES)
- .setShapeType(MLFaceAnalyzerSetting.TYPE_SHAPES)
- .setKeyPointType(MLFaceAnalyzerSetting.TYPE_KEYPOINTS)
- .setTracingAllowed(true)
- .create();
- MLFaceAnalyzer analyzer = MLAnalyzerFactory.getInstance().getFaceAnalyzer(setting);
| Method |
| public MLFaceAnalyzerSetting.Factory setFeatureType(int featureType) |
| Sets the detection mode of facial features and expressions of the analyzer. |
Parameters
| Parameter name | Parameter desc |
| featureType | Detection mode of facial features and expressions of the analyzer. TYPE_FEATURES: The value is 1, indicating that facial features and expressions are detected. TYPE_UNSUPPORT_FEATURES: The value is 2, indicating that facial features and expressions are not detected. |
Return
| Type | desc |
| MLFaceAnalyzerSetting.Factory | Returns the instance of MLFaceAnalyzerSetting.Factory. |
| Method |
| public MLFaceAnalyzerSetting.Factory setKeyPointType(int keyPointType) |
| Sets the facial key-point detection mode of the analyzer. |
Parameters
| Parameter name | Parameter desc |
| keyPointType | Facial key-point detection mode of the analyzer. TYPE_KEYPOINTS: The value is 0, indicating that facial key-points are detected. TYPE_UNSUPPORT_KEYPOINTS: The value is 2, indicating that facial key-points are not detected. |
Return
| Type | desc |
| MLFaceAnalyzerSetting.Factory | Returns the instance of MLFaceAnalyzerSetting.Factory. |
| Method |
| public MLFaceAnalyzerSetting.Factory setMaxSizeFaceOnly(boolean isMaxSizeFaceOnly) |
| Sets whether to detect only the largest face in an image. |
Parameters
| Parameter name | Parameter desc |
| isMaxSizeFaceOnly | Indicates whether to detect only the largest face. true: detect only the largest face false: detect all faces |
Return
| Type | desc |
| MLFaceAnalyzerSetting.Factory | Returns the instance of MLFaceAnalyzerSetting.Factory. |
Parameters
| Parameter name | Parameter desc |
| minFaceProportion | Sets the smallest proportion of a face in an image. |
Return
| Type | desc |
| MLFaceAnalyzerSetting.Factory | Returns the instance of MLFaceAnalyzerSetting.Factory. |
| Method |
| public MLFaceAnalyzerSetting.Factory setPerformanceType(int performanceType) |
| Sets the preference mode of the analyzer. |
Parameters
| Parameter name | Parameter desc |
| performanceType | Preference mode of the analyzer. TYPE_PRECISION: The value is 1, indicating the precision preference mode. This mode will detect more faces and be more precise in detecting key points and shapes, but will run slower. TYPE_SPEED: The value is 2, representing a preference for speed. This will detect fewer faces and be less precise in detecting key points and shapes, but will run faster. |
Return
| Type | desc |
| MLFaceAnalyzerSetting.Factory | Returns the instance of MLFaceAnalyzerSetting.Factory. |
| Method |
| public MLFaceAnalyzerSetting.Factory setShapeType(int shapeType) |
| Sets the facial shape detection mode of the analyzer. |
Parameters
| Parameter name | Parameter desc |
| shapeType | Facial shape detection mode of the analyzer. TYPE_SHAPES: The value is 2, indicating that facial shapes are detected. TYPE_UNSUPPORT_SHAPES: The value is 3, indicating that facial shapes are not detected. |
Return
| Type | desc |
| MLFaceAnalyzerSetting.Factory | Returns the instance of MLFaceAnalyzerSetting.Factory. |
| Method |
| public MLFaceAnalyzerSetting.Factory setTracingAllowed(boolean isTracingAllowed) |
| Sets whether to enable face tracking. |
Parameters
| Parameter name | Parameter desc |
| isTracingAllowed | Indicates whether to enable face tracking. true: enable face tracing false: disable face tracing |
Return
| Type | desc |
| MLFaceAnalyzerSetting.Factory | Returns the instance of MLFaceAnalyzerSetting.Factory. |