Skip to content

Instantly share code, notes, and snippets.

@m25lazi
Last active August 5, 2017 06:41
Show Gist options
  • Save m25lazi/2dd3105ffcca36edcab153da68b7d14c to your computer and use it in GitHub Desktop.
Save m25lazi/2dd3105ffcca36edcab153da68b7d14c to your computer and use it in GitHub Desktop.
Prediction API generated by Xcode from Inceptionv3 model
/**
Make a prediction using the convenience interface
- parameters:
- image: Input image to be classified as RGB image buffer, 299 pixels wide by 299 pixels high
- throws: an NSError object that describes the problem
- returns: the result of the prediction as Inceptionv3Output
*/
func prediction(image: CVPixelBuffer) throws -> Inceptionv3Output {
let input_ = Inceptionv3Input(image: image)
return try self.prediction(input: input_)
}
/// Model Prediction Output Type
class Inceptionv3Output : MLFeatureProvider {
/// Probability of each category as dictionary of strings to doubles
let classLabelProbs: [String : Double]
/// Most likely image category as string value
let classLabel: String
// Class has other APIs and properties.
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment