FirebaseVisionFaceDetectorOptions.Builder

public static class FirebaseVisionFaceDetectorOptions.Builder extends Object

Public Constructor Summary

Public Method Summary

FirebaseVisionFaceDetectorOptions
build()
Builds a face detector instance.
FirebaseVisionFaceDetectorOptions.Builder
setClassificationType(int classificationType)
Indicates whether to run additional classifiers for characterizing attributes such as "smiling" and "eyes open".
FirebaseVisionFaceDetectorOptions.Builder
setLandmarkType(int landmarkType)
Sets whether to detect no landmarks or all landmarks.
FirebaseVisionFaceDetectorOptions.Builder
setMinFaceSize(float minFaceSize)
Sets the smallest desired face size, expressed as a proportion of the width of the head to the image width.
FirebaseVisionFaceDetectorOptions.Builder
setModeType(int modeType)
Extended option for controlling additional accuracy / speed trade-offs in performing face detection.
FirebaseVisionFaceDetectorOptions.Builder
setTrackingEnabled(boolean trackingEnabled)
Enables or disables face tracking, which will maintain a consistent ID for each face when processing consecutive frames.

Inherited Method Summary

Public Constructors

public FirebaseVisionFaceDetectorOptions.Builder ()

Creates a new builder to build FirebaseVisionFaceDetectorOptions.

Public Methods

public FirebaseVisionFaceDetectorOptions build ()

Builds a face detector instance.

public FirebaseVisionFaceDetectorOptions.Builder setClassificationType (int classificationType)

Indicates whether to run additional classifiers for characterizing attributes such as "smiling" and "eyes open".

Default: NO_CLASSIFICATIONS

Parameters
classificationType the subset of classifiers to use. One of NO_CLASSIFICATIONS or ALL_CLASSIFICATIONS

public FirebaseVisionFaceDetectorOptions.Builder setLandmarkType (int landmarkType)

Sets whether to detect no landmarks or all landmarks. Processing time increases as the number of landmarks to search for increases, so detecting all landmarks will increase the overall detection time. Detecting landmarks can improve pose estimation.

Default: NO_LANDMARKS

Parameters
landmarkType the type of landmark detector to use. One of NO_LANDMARKS or ALL_LANDMARKS.

public FirebaseVisionFaceDetectorOptions.Builder setMinFaceSize (float minFaceSize)

Sets the smallest desired face size, expressed as a proportion of the width of the head to the image width. For example, if a value of 0.1 is specified then the smallest face to search for is roughly 10% of the width of the image being searched.

Setting the min face size is a performance vs. accuracy trade-off: setting the face size smaller will enable the detector to find smaller faces but detection will take longer; setting the face size larger will exclude smaller faces but will run faster.

This is not a hard limit on face size; the detector may find faces slightly smaller than specified.

Default minimum face size is 0.1.

Parameters
minFaceSize the smallest head size to search for relative to the size of the image, in the range of 0.0 and 1.0. For example, a setting of 0.5 would indicate that detected faces need to fill at least half of the image width.

public FirebaseVisionFaceDetectorOptions.Builder setModeType (int modeType)

Extended option for controlling additional accuracy / speed trade-offs in performing face detection. In general, choosing the more accurate mode will generally result in longer runtime, whereas choosing the faster mode will generally result in detecting fewer faces.

Default: FAST_MODE

Parameters
modeType fast/accurate trade-off mode. One of FAST_MODE or ACCURATE_MODE.

public FirebaseVisionFaceDetectorOptions.Builder setTrackingEnabled (boolean trackingEnabled)

Enables or disables face tracking, which will maintain a consistent ID for each face when processing consecutive frames. Tracking should be disabled for handling a series of non-consecutive still images.

Default: false