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: 8 months ago
JSON representation
Sample code for Core ML using ResNet50 provided by Apple and a custom model generated by coremltools.
- Host: GitHub
- URL: https://github.com/ytakzk/coreml-samples
- Owner: ytakzk
- License: mit
- Created: 2017-06-14T23:53:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-20T14:23:35.000Z (over 8 years ago)
- Last Synced: 2025-03-26T15:21:10.442Z (11 months ago)
- Topics: coreml, coreml-framework, deep-learning, ios, ios11, ml, resnet, swift
- Language: Jupyter Notebook
- Homepage:
- Size: 89.9 MB
- Stars: 44
- Watchers: 3
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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.

## 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)
}
```