FritzVisionStyleModel

@objc(FritzVisionStyleModel)
public class FritzVisionStyleModel : NSObject
  • Number of predictions waiting to be run asynchronously

    Declaration

    Swift

    @objc
    public var pendingAsyncPredictions: Int { get set }
  • Initialize FritzStyleTransferModel with your own trained style model.

    Declaration

    Swift

    @objc(initWithModel:)
    public init(model: SwiftIdentifiedModel)

    Parameters

    model

    Fritz model to use.

  • Run Style Transfer on a FritzVisionImage.

    Declaration

    Swift

    @objc(predict:options:completion:)
    public func predict(_ fritzImage: FritzVisionImage, options: FritzVisionStyleModelOptions = .init(), completion: @escaping (CVPixelBuffer?, Error?) -> Void)

    Parameters

    fritzImage

    Image or buffer to run model on.

    options

    Options for model execution.

    completion

    The block to invoke after the prediction request. Contains a FritzVisionSegmentationResult or error message.

  • Run prediction on a style transfer model asynchronously on the given queue.

    Declaration

    Swift

    @objc(predict:options:queue:completion:)
    public func predict(_ fritzImage: FritzVisionImage, options: FritzVisionStyleModelOptions = .init(), queue: DispatchQueue, completion: @escaping (CVPixelBuffer?, Error?) -> Void)

    Parameters

    fritzImage

    Image or buffer to run model on.

    options

    Options for model execution.

    queue

    DispatchQueue to run prediction on. This will run as an async request on the queue.

    completion

    The block to invoke after the prediction request has finished processing.