/// <summary> /// Make a prediction using the standard interface /// </summary> /// <param name="input">an instance of SqueezeNetInput to predict from</param> /// <param name="error">If an error occurs, upon return contains an NSError object that describes the problem.</param> public SqueezeNetOutput GetPrediction(SqueezeNetInput input, out NSError error) { var prediction = model.GetPrediction(input, out error); if (prediction == null) { return(null); } var classLabelProbs = prediction.GetFeatureValue("classLabelProbs").DictionaryValue; var classLabel = prediction.GetFeatureValue("classLabel").StringValue; return(new SqueezeNetOutput(classLabelProbs, classLabel)); }
/// <summary> /// Make a prediction using the convenience interface /// </summary> /// <param name="image">Input image to be classified as color (kCVPixelFormatType_32BGRA) image buffer, 227 pizels wide by 227 pixels high</param> /// <param name="error">If an error occurs, upon return contains an NSError object that describes the problem.</param> public SqueezeNetOutput GetPrediction(CVPixelBuffer image, out NSError error) { var input = new SqueezeNetInput(image); return(GetPrediction(input, out error)); }