FaceAnalyzer
class FaceAnalyzer : NSObject
Performs face analysis on the specified image/camera input, and gets analysed face as result.
-
The collection of properties and their values defined for this AZFaceAnalyzer.
Declaration
Swift
var properties: VisionPropertyCollection? { get }
-
The unique Session ID for this FaceAnalyzer.
Declaration
Swift
var sessionId: String? { get }
-
Creates a new instance of the FaceAnalyzer class.
Declaration
Swift
class func create(serviceOptions: VisionServiceOptions?, input: VisionSource, createOptions: FaceAnalyzerCreateOptions?) async throws -> FaceAnalyzer
Parameters
serviceOptions
vision service options.
input
vision source input.
createOptions
options for creating the FaceAnalyzer.
completionHandler
the block function to be called when the async operation has been completed.
Return Value
an instance of face analyzer.
-
Analyze one FaceAnalyzedResult from the input.
Declaration
Swift
func analyzeOnce(using options: FaceAnalysisOptions?) throws -> FaceAnalyzedResult
Parameters
options
Optional options for performing analysis.
outError
error information.
Return Value
the result of face analysis.
-
Analyze one FaceAnalyzedResult from the input, asynchronously.
Declaration
Swift
func analyzeOnce(using options: FaceAnalysisOptions?) async throws -> FaceAnalyzedResult
Parameters
options
Optional options for performing analysis.
resultReceivedHandler
the block function to be called when the face has been analyzed.
-
Stops analyzing results from the input.
Declaration
Swift
func stopAnalyzeOnce() throws
Parameters
outError
error information.
-
Starts analyzing results from the input, continuously.
Declaration
Swift
func startContinuousAnalysis(using options: FaceAnalysisOptions?) throws
Parameters
options
Optional options for performing analysis.
outError
error information.
-
Stops continuous analysis.
Declaration
Swift
func stopContinuousAnalysis() throws
Parameters
outError
error information.
-
Wait for analysis to stop.
Declaration
Swift
func waitForStop() throws
Parameters
outError
error information.
-
Wait for analysis to stop with timeout.
Declaration
Swift
func waitForStop(withTimeout timeout: uint) throws
Parameters
timeout
time to wait for stop in milliseconds.
outError
error information.
-
Subscribes to the Analyzing event which indicates that an intermediate result has been recognized.
Declaration
Swift
func addAnalyzingEventHandler(_ eventHandler: @escaping FaceAnalyzingEventHandler)
Parameters
eventHandler
The block that receives analyzing result. The block takes two arguments:
faceAnalyzer
event sender.
result
face analyzing result.
-
Subscribes to the Analyzed event which indicates that a final result has been recognized.
Declaration
Swift
func addAnalyzedEventHandler(_ eventHandler: @escaping FaceAnalyzedEventHandler)
Parameters
eventHandler
The block that receives analyzed result. The block takes two arguments:
faceAnalyzer
event sender.
result
face analyzed result.
-
Subscribes to the SessionStarted event indicating the start of a recognition session (operation).
Declaration
Swift
func addSessionStartedEventHandler(_ eventHandler: @escaping FaceSessionStartedEventHandler)
Parameters
eventHandler
The block that receives started details. The block takes two arguments:
faceAnalyzer
event sender.
sessionId
session ID.
-
Subscribes to the SessionStopped event indicating the end of a recognition session (operation).
Declaration
Swift
func addSessionStoppedEventHandler(_ eventHandler: @escaping FaceSessionStoppedEventHandler)
Parameters
eventHandler
The block that receives stopped details. The block takes three arguments:
faceAnalyzer
event sender.
sessionId
session ID.
reason
why the session stopped.