Montblanc 0.1.0

Montblanc 0.1.0

Maintained by Atsuya Sato.



Montblanc 0.1.0

  • By
  • Atsuya Sato

Header

Build Status Carthage Compatible

Montblanc

Montblanc is a wrapper for CoreML Model Compiler. Montblanc written in Swift🐧 and support iOS & OSX.

Requirements

  • Swift 4.1 or later

Usage

  • Fetch .mlmodel from remote & compile
import Montblanc

let url = URL(string: "https://docs-assets.developer.apple.com/coreml/models/MobileNet.mlmodel")!

Montblanc.request(url) { result in
    switch result {
    case .success(let model):
       // return compiled CoreML model
    case .failure(let error):
        Swift.print(error)
    }
}
  • Compile local .mlmodel file
import Montblanc

let path = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendPathComponent("your_file.mlmodel", isDirectory: false)

Montblanc.compile(path) { result in
    switch result {
    case .success(let model):
       // return compiled CoreML model
    case .failure(let error):
        Swift.print(error)
    }
}

Installation

Carthage

Add the following to your Cartfile:

  github "natmark/Montblanc"

License

Montblanc is available under the MIT license. See the LICENSE file for more info.