AI-generated Key Takeaways
- 
          FaceDetectorOptions.Builder is a class used to create a FaceDetectorOptions instance. 
- 
          It allows you to configure various settings for face detection, such as enabling tracking, setting classification, contour, and landmark modes, defining the minimum face size, and choosing the performance mode. 
- 
          The build() method is used to finalize the options and build the face detector instance. 
- 
          You can optionally set a custom Executor for the detector. 
Builder class of FaceDetectorOptions.
Public Constructor Summary
| 
                  
                  Builder()
                   
                    Creates a new builder to build  FaceDetectorOptions. | 
Public Method Summary
| FaceDetectorOptions | 
                  
                  build()
                   
                    Builds a face detector instance.
                   | 
| FaceDetectorOptions.Builder | 
                  
                  enableTracking()
                   
                    Enables face tracking, which will maintain a consistent ID for each face when
                    processing consecutive frames.
                   | 
| FaceDetectorOptions.Builder | 
                  
                  setClassificationMode(int classificationMode)
                   
                    Indicates whether to run additional classifiers for characterizing attributes
                    such as "smiling" and "eyes open" as defined in  
                    FaceDetectorOptions.ClassificationMode. | 
| FaceDetectorOptions.Builder | 
                  
                  setContourMode(int contourMode)
                   
                    Sets whether to detect no contours or all contours as defined in  
                    FaceDetectorOptions.ContourMode. | 
| FaceDetectorOptions.Builder | |
| FaceDetectorOptions.Builder | 
                  
                  setLandmarkMode(int landmarkMode)
                   
                    Sets whether to detect no landmarks or all landmarks as defined in
                     
                    FaceDetectorOptions.LandmarkMode. | 
| FaceDetectorOptions.Builder | 
                  
                  setMinFaceSize(float minFaceSize)
                   
                    Sets the smallest desired face size, expressed as a proportion of the width of
                    the head to the image width.
                   | 
| FaceDetectorOptions.Builder | 
                  
                  setPerformanceMode(int performanceMode)
                   
                    Extended option for controlling additional accuracy / speed trade-offs in
                    performing face detection as defined in  
                    FaceDetectorOptions.PerformanceMode. | 
Inherited Method Summary
Public Constructors
public Builder ()
Creates a new builder to build FaceDetectorOptions.
Public Methods
public FaceDetectorOptions build ()
Builds a face detector instance.
public FaceDetectorOptions.Builder enableTracking ()
Enables 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.
public FaceDetectorOptions.Builder setClassificationMode (int classificationMode)
Indicates whether to run additional classifiers for characterizing attributes such
            as "smiling" and "eyes open" as defined in 
            FaceDetectorOptions.ClassificationMode.
Parameters
| classificationMode | the classification mode used by the detector. One of 
                FaceDetectorOptions.CLASSIFICATION_MODE_NONEor
                FaceDetectorOptions.CLASSIFICATION_MODE_ALL | 
|---|
public FaceDetectorOptions.Builder setContourMode (int contourMode)
Sets whether to detect no contours or all contours as defined in FaceDetectorOptions.ContourMode.
            Processing time increases as the number of contours to search for increases, so
            detecting all contours will increase the overall detection time. Note that contours are
            detected for only the most prominent face in an image.
Parameters
| contourMode | the contour mode used by the detector. One of 
                FaceDetectorOptions.CONTOUR_MODE_NONEor
                FaceDetectorOptions.CONTOUR_MODE_ALL. | 
|---|
public FaceDetectorOptions.Builder setExecutor (Executor executor)
public FaceDetectorOptions.Builder setLandmarkMode (int landmarkMode)
Sets whether to detect no landmarks or all landmarks as defined in 
            FaceDetectorOptions.LandmarkMode. 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.
Parameters
| landmarkMode | the landmark mode used by the detector. One of 
                FaceDetectorOptions.LANDMARK_MODE_NONEor
                FaceDetectorOptions.LANDMARK_MODE_ALL. | 
|---|
public FaceDetectorOptions.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 may 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, so it can not be used to filter out face sizes.
Default minimum face size is 0.1.
Parameters
| minFaceSize | the 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 is preferred to fill at least half of the image width. However, the detector may still find faces slightly smaller than specified, so it can not be used to filter out face sizes. | 
|---|
public FaceDetectorOptions.Builder setPerformanceMode (int performanceMode)
Extended option for controlling additional accuracy / speed trade-offs in performing
            face detection as defined in 
            FaceDetectorOptions.PerformanceMode. 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.
Parameters
| performanceMode | fast/accurate trade-off mode. One of 
                FaceDetectorOptions.PERFORMANCE_MODE_FASTor
                FaceDetectorOptions.PERFORMANCE_MODE_ACCURATE. | 
|---|
