A request that determines the capture quality of faces in a photo.
This request produces one ``FaceObservation`` object for each face analyzed. The `FaceObservation` will have a non-nil `captureQuality` containing a score that ranges in value from 0 to 1. Faces with quality closer to 1 are better lit, sharper, and more centrally positioned than faces with quality closer to 0.
By default, a capture quality request first locates all faces in the input image, then analyzes each to detect capture quality.
If you’ve already located all the faces in an image, or want to detect capture quality in only a subset of the faces in the image, set the `inputFaceObservations` property to an array of `FaceObservation` objects representing the faces you want to analyze. You can either use face observations output by a ``DetectFaceRectanglesRequest`` or manually create `FaceObservation` instances with the bounding boxes of the faces you want to analyze.
Members (9)
get · iOS 18.0+
inputFaceObservations
TypeScript
get inputFaceObservations(): (Array<FaceObservation>) | null
Swift declaration
var inputFaceObservations: [FaceObservation]?
An array of `FaceObservation` objects to process as part of the request.
The default is nil. When nil, Vision will first perform a `DetectFaceRectanglesRequest` and process all faces detected.
set · iOS 18.0+
inputFaceObservations
TypeScript
set inputFaceObservations(value: (Array<FaceObservation>) | null)
Swift declaration
var inputFaceObservations: [FaceObservation]?
An array of `FaceObservation` objects to process as part of the request.
The default is nil. When nil, Vision will first perform a `DetectFaceRectanglesRequest` and process all faces detected.
get · iOS 18.0+
descriptor
TypeScript
get descriptor(): RequestDescriptor
Swift declaration
var descriptor: RequestDescriptor { get }
An enum that identifies the request and request revision.
get · iOS 18.0+
regionOfInterest
TypeScript
get regionOfInterest(): NormalizedRect
Swift declaration
var regionOfInterest: NormalizedRect
The region of the image in which Vision will perform the request.
The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image's lower-left corner.
By default, the region of interest will be the full image.
set · iOS 18.0+
regionOfInterest
TypeScript
set regionOfInterest(value: NormalizedRect)
Swift declaration
var regionOfInterest: NormalizedRect
The region of the image in which Vision will perform the request.
The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image's lower-left corner.
By default, the region of interest will be the full image.
mutating func setComputeDevice(_ computeDevice: MLComputeDevice?, for computeStage: ComputeStage)
Assigns a compute device for a compute stage.
If the parameter `computeDevice` is `nil`, the framework removes any explicit compute device assignment and allows the framework to select the device.
Configure any compute device for a given compute stage. When performing a request, the system makes a validity check. Use `supportedComputeStageDevices` to get valid compute devices for a request’s compute stages.
- Parameters:
- `computeDevice: `The compute device to assign to the compute stage.
- `computeStage: `The compute stage.
get · iOS 18.0+
supportedRevisions
TypeScript
static get supportedRevisions(): Array<DetectFaceCaptureQualityRequest_Revision>
Swift declaration
static let supportedRevisions: [DetectFaceCaptureQualityRequest.Revision]
The collection of currently-supported revisions for `DetectFaceCaptureQualityRequest`.
get · iOS 18.0+
revision
TypeScript
get revision(): DetectFaceCaptureQualityRequest_Revision
Swift declaration
let revision: DetectFaceCaptureQualityRequest.Revision