FacialTrainingModel

A base class containing details specific to facial training

Declaration

@objc final public class FacialTrainingModel : NSObject, Encodable {
    @objc final public var identifier: String { get }
    @objc final public var trainingTimeTakenMilliseconds: Double { get }
    @objc final public var uploadTimeTakenMilliseconds: Double { get }
    @objc final public var trainedImages: [UIImage] { get }
    @objc final public var uploaded: Bool { get }
    
    @objc final public func uploadModel(success: ((Double) -> Void)? = nil, failure: ((String) -> Void)? = nil)
    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

String

The unique identifier of the model that was trained.

Double

The time it took to train the model, using the faces in the trainedImages array, in milliseconds.

Double

The time it took to upload the model to the Sybrin cloud, in milliseconds. 0 if uploaded is false.

[UIImage]

The images that were used to train the model.

Bool

Indicates if the trained model is uploaded to the Sybrin cloud.

Public methods

Signature

Return Type

Description

Void

Uploads the trained model to the Sybrin cloud. Only executes if uploaded is false.

Void

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

Public variables

identifier

@objc final public var identifier: String { get }

The unique identifier of the model that was trained.

trainingTimeTakenMilliseconds

@objc final public var trainingTimeTakenMilliseconds: Double { get }

The time it took to train the model, using the faces in the trainedImages array, in milliseconds.

uploadTimeTakenMilliseconds

@objc final public var uploadTimeTakenMilliseconds: Double { get }

The time it took to upload the model to the Sybrin cloud, in milliseconds. 0 if uploaded is false.

trainedImages

@objc final public var trainedImages: [UIImage] { get }

The images that were used to train the model.

uploaded

@objc final public var uploaded: Bool { get }

Indicates if the trained model is uploaded to the Sybrin cloud.

Public methods

uploadModel(success: ((Double) -> Void)? = nil, failure: ((String) -> Void)? = nil)

@objc final public func uploadModel(success: ((Double) -> Void)? = nil, failure: ((String) -> Void)? = nil)

Uploads the trained model to the Sybrin cloud. Only executes if uploaded is false.

success: ((Double) -> Void)? = nil

Handling this closure is optional

Will be called after uploading succeeds. Contains one parameter which is the uploadTimeTakenMilliseconds.

failure: ((String) -> Void)? = nil

Handling this closure is optional

Will be called after uploading fails. Contains one parameter which is a string explaining why uploading failed.

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.

Where this is used

Last updated