Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/ytakzk/CoreML-samples

Sample code for Core ML using ResNet50 provided by Apple and a custom model generated by coremltools.
https://github.com/ytakzk/CoreML-samples

coreml coreml-framework deep-learning ios ios11 ml resnet swift

Last synced: about 2 months ago
JSON representation

Sample code for Core ML using ResNet50 provided by Apple and a custom model generated by coremltools.

Lists

README

        

# CoreML-samples

This is the sample code for Core ML using ResNet50 provided by [Apple](https://developer.apple.com/machine-learning/).
[ResNet50](https://arxiv.org/abs/1512.03385) can categorize the input image to 1000 pre-trained categories.
What's more, this includes a sample code for coremltools converting keras model to mlmodel.

demo

## Source Code for the prediction
```
guard let image = imageView.image, let ref = image.buffer() else {

return
}

do {

// predict
let output = try model.prediction(image: ref)

print(output.classLabel)
print(output.classLabelProbs)

} catch {

print(error)
}
```