FacialComparisonModel

A base class containing details specific to facial comparison

Declaration

@objc final public class FacialComparisonModel : NSObject, Encodable {
    @objc final public var averageConfidence: Double { get }
    @objc final public var targetImage: UIImage? { get }
    @objc final public var targetImagePath: String? { get }
    @objc final public var faceResults: [FacialComparisonResult]? { get }
    
    @objc final public func saveImages()
    final public func encode(to encoder: Encoder) throws
}

Only relevant details are shown, boilerplate or standard Swift generated code is omitted

Summary

Public variables

Name

Type

Description

Double

The average confidence of the all the faceResults' confidence.

UIImage?

The target image you passed through.

String?

The path to targetImage, after it is saved. Otherwise nil.

An array of all the results that facial comparison executed.

Public methods

Signature

Return Type

Description

Void

Saves the targetImage and populates its respective path variable. Also iterates through all the facial comparison results and calls saveImages() on each result.

Void

Encodes the model using the encoder provided. Used to convert the model to JSON.

Public variables

averageConfidence

@objc final public var averageConfidence: Double { get }

The average confidence of the all the faceResults' confidence.

Range: 0 - 1

targetImage

@objc final public var targetImage: UIImage? { get }

The target image you passed through.

targetImagePath

@objc final public var targetImagePath: String? { get }

The path to targetImage, after it is saved. Otherwise nil.

faceResults

@objc final public var faceResults: [FacialComparisonResult]? { get }

An array of all the results that facial comparison executed.

Public methods

saveImages()

@objc final public func saveImages()

Saves the targetImage and populates its respective path variable. Also iterates through all the facial comparison results and calls saveImages() on each result.

encode(to encoder: Encoder)

final public func encode(to encoder: Encoder) throws

Encodes the model using the encoder provided. Used to convert the model to JSON.

See also

Where this is used

Last updated