Created
June 11, 2018 00:18
-
-
Save AlexFWulff/6b506ac51c299cd486b64174fff27085 to your computer and use it in GitHub Desktop.
This file contains 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 model = try? VNCoreMLModel(for: DogNet().model) | |
let request = VNCoreMLRequest(model: model!) { (request, error) in | |
let results = request.results as! [VNClassificationObservation] | |
for result in results { | |
print("\(result.identifier) | \(result.confidence)") | |
} | |
} | |
let handler = VNImageRequestHandler.init(cgImage: UIImage(named: "Chelsea.JPG")!.cgImage!, options: [:]) | |
try? handler.perform([request]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment