Last active
May 23, 2018 09:46
-
-
Save codePrincess/382ef086a5fba5bfc99088332a2de6f7 to your computer and use it in GitHub Desktop.
Do a prediction with CoreML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let image = UIImage(named:"catinmood") | |
do { | |
let pixelBuffer = image.pixelBuffer(width: 227, height:227) | |
let classifierRequestHandler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer!, options: [:]) | |
try classifierRequestHandler.perform(classificationRequest!) | |
} catch { | |
print("something went terribly wrong during classification") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment