GithubHelp home page GithubHelp logo

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.

mlfairy's Projects

mlfairy icon mlfairy

Improve your CoreML models with MLFairy

promises icon promises

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.