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

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