Beispiel #1
0
        /// <summary>
        /// Make a prediction using the standard interface
        /// </summary>
        /// <param name="input">an instance of Inceptionv3Input to predict from</param>
        /// <param name="error">If an error occurs, upon return contains an NSError object that describes the problem.</param>
        public Inceptionv3Output GetPrediction(Inceptionv3Input input, out NSError error)
        {
            var prediction = Model.GetPrediction(input, out error);

            if (prediction == null)
            {
                return(null);
            }

            var classLabelProbsValue = prediction.GetFeatureValue("classLabelProbs").DictionaryValue;
            var classLabelValue      = prediction.GetFeatureValue("classLabel").StringValue;

            return(new Inceptionv3Output(classLabelProbsValue, classLabelValue));
        }
Beispiel #2
0
        /// <summary>
        /// Make a prediction using the convenience interface
        /// </summary>
        /// <param name="image">Input image to be classified as color (kCVPixelFormatType_32RGBA) image buffer, 299 pizels wide by 299 pixels high</param>
        /// <param name="error">If an error occurs, upon return contains an NSError object that describes the problem.</param>
        public Inceptionv3Output GetPrediction(CVPixelBuffer image, out NSError error)
        {
            var input = new Inceptionv3Input(image);

            return(GetPrediction(input, out error));
        }