MLKitFaceDetection Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
MLKFaceDetectorOptions
@interface MLKFaceDetectorOptions : NSObject
Options for specifying a face detector.
-
The face detector classification mode for characterizing attributes such as smiling. The default
is .none
.
-
The face detector performance mode that determines the accuracy of the results and the speed of
the detection. The default is .fast
.
-
The face detector landmark mode that determines the type of landmark results returned by
detection. The default is .none
.
-
The face detector contour mode that determines the type of contour results returned by detection.
The default is .none
.
The following detection results are returned when setting this mode to .all
:
performanceMode
set to .fast
, and both classificationMode
and landmarkMode
set to
.none
, then only the prominent face will be returned with detected contours.
performanceMode
set to .accurate
, or if classificationMode
or landmarkMode
is set to
.all
, then all detected faces will be returned, but only the prominent face will have
detecteted contours.
-
The smallest desired face size. The size is 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. The default is 0.1. This option does
not apply to contour detection.
Declaration
Objective-C
@property (nonatomic) CGFloat minFaceSize;
-
Whether the face tracking feature is enabled for face detection. The default is NO. When
performanceMode
is set to .fast
, and both classificationMode
and landmarkMode
set to
.none
, this option will be ignored and tracking will be disabled.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite,
getter=isTrackingEnabled) BOOL trackingEnabled;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eMLKFaceDetectorOptions\u003c/code\u003e allows you to configure the behavior of the face detector, such as classification, performance, landmark detection, and contour detection.\u003c/p\u003e\n"],["\u003cp\u003eYou can control the accuracy and speed of face detection by setting the \u003ccode\u003eperformanceMode\u003c/code\u003e property to either \u003ccode\u003efast\u003c/code\u003e or \u003ccode\u003eaccurate\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eclassificationMode\u003c/code\u003e enables detection of facial attributes like smiling, while \u003ccode\u003elandmarkMode\u003c/code\u003e and \u003ccode\u003econtourMode\u003c/code\u003e control the detection of facial landmarks and contours, respectively.\u003c/p\u003e\n"],["\u003cp\u003eIt's possible to specify the minimum detectable face size using the \u003ccode\u003eminFaceSize\u003c/code\u003e property and enable or disable face tracking with the \u003ccode\u003etrackingEnabled\u003c/code\u003e property.\u003c/p\u003e\n"]]],["MLKFaceDetectorOptions configures a face detector with several customizable properties. These include `classificationMode` for attribute detection (default: `.none`), `performanceMode` for speed/accuracy balance (default: `.fast`), and `landmarkMode` (default: `.none`) and `contourMode` (default: `.none`) for landmark/contour detection. The `minFaceSize` (default: 0.1) sets the smallest detectable face size. Finally, `trackingEnabled` (default: NO) toggles face tracking, which may be disabled depending on performance, classification, and landmark modes.\n"],null,["# MLKitFaceDetection Framework Reference\n\nMLKFaceDetectorOptions\n======================\n\n\n @interface MLKFaceDetectorOptions : NSObject\n\nOptions for specifying a face detector.\n- `\n ``\n ``\n `\n\n ### [classificationMode](#/c:objc(cs)MLKFaceDetectorOptions(py)classificationMode)\n\n `\n ` \n The face detector classification mode for characterizing attributes such as smiling. The default\n is `.none`. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic) ../Type-Definitions.html#/c:MLKFaceDetectorOptions.h@T@MLKFaceDetectorClassificationMode classificationMode;\n\n- `\n ``\n ``\n `\n\n ### [performanceMode](#/c:objc(cs)MLKFaceDetectorOptions(py)performanceMode)\n\n `\n ` \n The face detector performance mode that determines the accuracy of the results and the speed of\n the detection. The default is `.fast`. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic) ../Type-Definitions.html#/c:MLKFaceDetectorOptions.h@T@MLKFaceDetectorPerformanceMode performanceMode;\n\n- `\n ``\n ``\n `\n\n ### [landmarkMode](#/c:objc(cs)MLKFaceDetectorOptions(py)landmarkMode)\n\n `\n ` \n The face detector landmark mode that determines the type of landmark results returned by\n detection. The default is `.none`. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic) ../Type-Definitions.html#/c:MLKFaceDetectorOptions.h@T@MLKFaceDetectorLandmarkMode landmarkMode;\n\n- `\n ``\n ``\n `\n\n ### [contourMode](#/c:objc(cs)MLKFaceDetectorOptions(py)contourMode)\n\n `\n ` \n The face detector contour mode that determines the type of contour results returned by detection.\n The default is `.none`.\n\n \u003cbr /\u003e\n\n The following detection results are returned when setting this mode to `.all`:\n\n \u003cbr /\u003e\n\n [performanceMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)performanceMode) set to `.fast`, and both [classificationMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)classificationMode) and [landmarkMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)landmarkMode) set to\n `.none`, then only the prominent face will be returned with detected contours.\n\n \u003cbr /\u003e\n\n [performanceMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)performanceMode) set to `.accurate`, or if [classificationMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)classificationMode) or [landmarkMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)landmarkMode) is set to\n `.all`, then all detected faces will be returned, but only the prominent face will have\n detecteted contours. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic) ../Type-Definitions.html#/c:MLKFaceDetectorOptions.h@T@MLKFaceDetectorContourMode contourMode;\n\n- `\n ``\n ``\n `\n\n ### [minFaceSize](#/c:objc(cs)MLKFaceDetectorOptions(py)minFaceSize)\n\n `\n ` \n The smallest desired face size. The size is expressed as a proportion of the width of the head to\n the image width. For example, if a value of 0.1 is specified, then the smallest face to search\n for is roughly 10% of the width of the image being searched. The default is 0.1. This option does\n not apply to contour detection. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic) CGFloat minFaceSize;\n\n- `\n ``\n ``\n `\n\n ### [trackingEnabled](#/c:objc(cs)MLKFaceDetectorOptions(py)trackingEnabled)\n\n `\n ` \n Whether the face tracking feature is enabled for face detection. The default is NO. When\n [performanceMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)performanceMode) is set to `.fast`, and both [classificationMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)classificationMode) and [landmarkMode](../Classes/MLKFaceDetectorOptions.html#/c:objc(cs)MLKFaceDetectorOptions(py)landmarkMode) set to\n `.none`, this option will be ignored and tracking will be disabled. \n\n #### Declaration\n\n Objective-C \n\n @property (nonatomic, assign, unsafe_unretained, readwrite,\n getter=isTrackingEnabled) BOOL trackingEnabled;"]]