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

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

            var lossValue       = prediction.GetFeatureValue("loss").DictionaryValue;
            var classLabelValue = prediction.GetFeatureValue("classLabel").StringValue;

            return(new shoesOutput(lossValue, classLabelValue));
        }
Example #2
0
        /// <summary>
        /// Make a prediction using the convenience interface
        /// </summary>
        /// <param name="data"> 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 shoesOutput GetPrediction(CVPixelBuffer data, out NSError error)
        {
            var input = new shoesInput(data);

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