FaceTemplateUtility

public class FaceTemplateUtility

Utility for comparing and converting Ver-ID face templates

Since

1.0.0
  • Default standard deviation value to use at comparison

    Since

    2.1.0

    Declaration

    Swift

    public static let defaultStandardDeviation: Float
  • Standard deviation used when comparing face templates

    Since

    2.1.0

    Declaration

    Swift

    private(set) public var standardDeviation: Float

Setup

  • Initialize an instance with default settings

    Since

    2.1.0

    Declaration

    Swift

    public static var `default`: FaceTemplateUtility { get }
  • Initialize an instance with unit norm (1)

    Since

    2.1.0

    Declaration

    Swift

    public static var withUnitNorm: FaceTemplateUtility { get }
  • Initialize an instance with given standard deviation to use when comparing face templates

    Since

    2.1.0

    Declaration

    Swift

    public static func withStandardDeviation(_ standardDeviation: Float) -> FaceTemplateUtility

    Parameters

    standardDeviation

    Standard deviation

  • Set standard deviation on an instance and return the instance

    Since

    2.1.0

    Declaration

    Swift

    public func setStandardDeviation(_ standardDeviation: Float) -> FaceTemplateUtility

    Parameters

    standardDeviation

    Standard deviation

Face template comparison

  • Compare two face templates

    Since

    1.0.0

    Declaration

    Swift

    public static func compareFaceTemplate(_ template1: String, to template2: String) throws -> Float

    Parameters

    template1

    First face template

    template2

    Second face template

  • Compare two face templates

    Since

    1.0.0

    Declaration

    Swift

    public static func compareFaceTemplate(_ template1: [Float], to template2: [Float]) -> Float

    Parameters

    template1

    First face template

    template2

    Second face template

  • Compare two face templates using given norms

    Since

    1.0.0

    Declaration

    Swift

    public static func compareFaceTemplate(_ template1: [Float], withNorm norm1: Float, to template2: [Float], withNorm norm2: Float) -> Float

    Parameters

    template1

    First face template

    norm1

    First face template norm

    template2

    Second face template

    norm2

    Second face template norm

  • Get norm for face template

    Since

    1.0.0

    Declaration

    Swift

    public static func normForTemplate(_ template: [Float]) -> Float

    Parameters

    template

    Face template

  • Compare two face templates

    Note

    The return value will depend on the value of the standardDeviation property.

    Since

    2.1.0

    Declaration

    Swift

    public func compareFaceTemplate(_ template1: FaceTemplateConvertible, to template2: FaceTemplateConvertible) throws -> Float

    Parameters

    template1

    First face template

    template2

    Second face template

    Return Value

    Score that indicates similarity between the two templates

  • Compare two face templates

    Note

    The return value will depend on the value of the standardDeviation property.

    Since

    2.1.0

    Declaration

    Swift

    public func compareFaceTemplate(_ template1: [Float], to template2: [Float]) -> Float

    Parameters

    template1

    First face template

    template2

    Second face template

    Return Value

    Score that indicates similarity between the two templates

  • Get a norm for the specified face template

    Since

    2.1.0

    Declaration

    Swift

    public func normForFaceTemplate(_ template: FaceTemplateConvertible) throws -> Float

    Parameters

    template

    Face template

  • Get a norm for the specified face template

    Since

    2.1.0

    Declaration

    Swift

    public func normForFaceTemplate(_ faceTemplate: [Float]) -> Float

    Parameters

    template

    Face template

Face template conversion

  • Convert face template to string

    Note

    As of version 2.1.0 the framework contains a String extension that conforms to FaceTemplateEncodable, making this function redundant.

    Since

    1.0.0

    Declaration

    Swift

    public static func stringFromFaceTemplate(_ template: [Float]) -> String

    Parameters

    template

    Face template to be converted

  • Convert string to face template

    Note

    As of version 2.1.0 the framework contains a String extension that conforms to FaceTemplateDecodable, making this function redundant.

    Since

    1.0.0

    Declaration

    Swift

    public static func faceTemplateFromString(_ string: String) throws -> [Float]

    Parameters

    string

    String representing base 64 encoded face template