Skip to main content

NCKitModelLocator

Locates the bundled NCKit model and returns a filesystem path for NCKitProcessor.

API​

Swift
public enum NCKitModelLocator {
public static var defaultBundle: Bundle { get }

public static func modelTarGzURL(bundle: Bundle = defaultBundle) throws -> URL
}

Usage​

Swift
import NCKit

let modelURL = try NCKitModelLocator.modelTarGzURL()
Swift
// Optional: search a specific bundle first, then Bundle.main
let modelURL = try NCKitModelLocator.modelTarGzURL(bundle: .main)

On Android the locator tries NCKit_model.dfn3, then NCKit_model.tar.gz, then the older DeepFilterNet3_onnx.dfn3. The first match is copied to cache/nckit_model.tar.gz.

Throws​

ErrorWhen
NCKitError.missingModel / NCKitException.MissingModelModel not found in bundle / AAR assets