Skip to content

Instantly share code, notes, and snippets.

@AlexFWulff
Created June 11, 2018 00:18
Show Gist options
  • Save AlexFWulff/6b506ac51c299cd486b64174fff27085 to your computer and use it in GitHub Desktop.
Save AlexFWulff/6b506ac51c299cd486b64174fff27085 to your computer and use it in GitHub Desktop.
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