MLFairy 0.0.3

MLFairy 0.0.3

MLFairy 维护。



 
依赖
Alamofire~> 5.0.0-rc.2
MLFSupport>= 0
PromisesSwift~> 1.2.8
MLFPromisesSwift~> 1.2.8
 

MLFairy 0.0.3

  • 作者
  • MLFairy

MLFairy

Build Status Carthage compatible CocoaPods compatible codebeat badge Platforms

MLFairy 为开发者提供了更好地理解他们 CoreML 模型所需的工具。它使开发者能够更新和部署他们最新的 CoreML 模型。MLFairy 还允许你收集来自您的模型的预测,因此你可以根据您应用程序在现实世界中的结果来改进您的模型。

安装

CocoaPods

对于 MLFairy,在你的 Podfile 中使用以下条目

pod 'MLFairy' '~> 0.0.2'

然后运行 pod install

在你想使用 MLFairy 的任何文件中,别忘了用 import MLFairy 导入框架。

Carthage

在你的 Cartfile 中添加以下条目

github "mlfairy/mlfairy" ~> 0.0.2

然后运行 carthage update

如果你第一次在项目中使用 Carthage,你需要完成一些额外步骤,具体说明请参照 Carthage 的说明

使用方法

下载最新的CoreML模型

安装 MLFairy 后,你可以使用如下 API

private let TOKEN = "<get your token from your account at www.mlfairy.com>"

let model = <Generated Class from .mlmodel file>()

MLFairy.getCoreMLModel(TOKEN) { response in
    switch (response.result) {
        case .success(let model):
            guard let model = model else {
                print("Failed to get CoreML model.")
                return
            }

            // Assign the returned model to your existing model
            // If you want to collect predictions, you can assign your model to response.mlFairyModel
            model.model = model
        case .failure(let error):
            print("Failed to get CoreML model \(String(describing: error)).")
    }
}

自动收集预测结果

你可以通过 MLFairy 收集你模型的预测结果。你可以使用 MLFairy.wrapCoreMLModel 来这样做。

private let TOKEN = "<get your token from your account at www.mlfairy.com>"

let model = <Generated Class from .mlmodel file>()

model.model = MLFairy.wrapCoreMLModel(model.model, token: TOKEN)

注意: MLFairy.getCoreMLModel 也会在你使用 MLFairy 进行模型分发时返回一个可选的包装模型。

证书

MLFairy 以 GPL-3 许可证发布。更多信息请查阅 License.txt