Example #1
0
        /// <summary>
        /// Make a prediction using the standard interface
        /// </summary>
        /// <param name="input">an instance of PokemonInput to predict from</param>
        /// <param name="error">If an error occurs, upon return contains an NSError object that describes the problem.</param>
        public PokemonOutput GetPrediction(PokemonInput 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 PokemonOutput(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 PokemonOutput GetPrediction(CVPixelBuffer data, out NSError error)
        {
            var input = new PokemonInput(data);

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