public void evaluate() { if (this.texture != null) { var result = model.Predict(this.texture).Best(); resultLabel.text = $"{result.Label}: {result.Confidence.ToString()}"; } }
public void PredictRose() { var photo = Resources.Load <Texture2D>("Materials/rose"); var prediction = model.Predict(photo); var best = prediction.Best(); predictionResult.text = best.Label + ": " + best.Confidence.ToString(); Debug.Log("Guessing: " + best.Label + ": " + best.Confidence.ToString()); string z = ""; foreach (var r in prediction.SortedResults) { z += r.Label + ": " + r.Confidence + ", "; } Debug.Log(z); }
private void Update() { if (this.model != null && this.texture != null) { CoachResult prediction; if (sync) { prediction = model.Predict(this.texture); } else { prediction = model.GetPredictionResultAsync(); StartCoroutine(model.PredictAsync(this.texture)); } if (prediction != null) { var result = prediction.Best(); var printedResult = $"{result.Label}: {result.Confidence.ToString()}"; Debug.Log((sync ? "sync" : "async") + " || " + printedResult); resultLabel.text = printedResult; } } }