Skip to content

Instantly share code, notes, and snippets.

@codePrincess
Created March 27, 2018 14:02
Show Gist options
  • Save codePrincess/2a97c70f5900d1c4bda516cb66bc18cd to your computer and use it in GitHub Desktop.
Save codePrincess/2a97c70f5900d1c4bda516cb66bc18cd to your computer and use it in GitHub Desktop.
func recognizeWithLocalModel(_ image: UIImage) {
if let data = generateMultiArrayFrom(image: image) {
guard let modelOutput = try? singleNumberModel?.prediction(input: data) else {
return
}
if let result = modelOutput?.classLabel {
self.addLabelForOCR(text: "\(result)")
} else {
print("no result available")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment