Installing the SDK in your app
The MLFairy SDK allows you to use the MLFairy service to securely distribute your CoreML models, and to collect prediction inputs and outputs.
MLFairy supports iOS 11, tvOS 11, watchOS 4.0 and OSX 10.13
MLFairy requires at minimum Xcode 11.1. It can be installed using Cocoapods or Carthage.
Cocoapods
Once you have Cocoapods installed, you can begin adding SDK to your project.
Add the MLFairy pod to your Podfile
by inserting the following line where applicable:
pod 'MLFairy'
Run the pod install
command to install the MLFairy dependency.
Carthage
Once you have Carthage installed, you can begin adding frameworks to your project.
- Add
github "mlfairy/mlfairy"
to your Cartfile. - Run
carthage update
from the terminal in the same directory as your Cartfile. - On your application targets' "General" settings tab, in the "Linked Frameworks and Libraries" section, drag and drop the
MLFairy.framework
from the Carthage/Build folder on disk. The MLFairy SDK depends on Alamofire and Google/Promises, so you will also have to addAlamofire.framework
,Promises.framework
andFBLPromises.framework
to your project. - On your application targets' "Build Phases" settings tab, click the "+" icon and choose "New Run Script Phase". Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:
/usr/local/bin/carthage copy-frameworks
and add the paths to the MLFairy frameworks and dependencies under "Input Files", e.g.:
${SRCROOT}/Carthage/Build/iOS/Alamofire.framework
${SRCROOT}/Carthage/Build/iOS/FBLPromises.framework
${SRCROOT}/Carthage/Build/iOS/Promises.framework
${SRCROOT}/Carthage/Build/iOS/MLFSupport.framework
${SRCROOT}/Carthage/Build/iOS/MLFairy.framework
Contributing to the SDK
If you'd like to contribute to the MLFairy SDK, the code is open source and hosted on github.com.
Once you have the SDK installed in your app, you can use MLFairy to either download your CoreML models to your app, or collect on device predictions.