Skip to content
View mlfairy's full-sized avatar
Block or Report

Block or report mlfairy

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
mlfairy/README.md

MLFairy

codebeat badge Platforms

MLFairy gives developers the tools needed to better understand their CoreML models. It gives them the ability to update and deploy their latest CoreML model. MLFairy also gives you the ability to collect predictions from your model, so you can improve your model based on real-world results from your app.

Installation

MLFairy only supports Swift Package Manager, add the following to your Package.swift

.package(name: "MLFairy", url: "https://github.com/mlfairy/mlfairy.git", from: "0.0.3"),

Or add the following URL when adding the dependencies in Xcode through File > Swift Packages > Add Package Dependencies

https://github.com/mlfairy/mlfairy.git

Usage

Downloading the latest CoreML model

After installing MLFairy, you can access an API like this:

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)).")
	}
}

Automatically collect predictions

You can collect your model's predictions using MLFairy. You can do this with 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)

Note: MLFairy.getCoreMLModel also returns an optional wrapped model if you are using MLFairy for model distribution.

License

MLFairy is released under an GPL-3 license. See License.txt for more information.

Popular repositories Loading

  1. homebrew-createmlfairy homebrew-createmlfairy Public

    A CLI wrapper around CreateML

    Swift 2

  2. mlfairy mlfairy Public

    Improve your CoreML models with MLFairy

    Swift 1

  3. promises promises Public

    Forked from google/promises

    Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.

    Objective-C

  4. sdk-support-spm sdk-support-spm Public

    Swift