Skip to content

Instantly share code, notes, and snippets.

@lbugnion
Created June 24, 2019 03:03
Show Gist options
  • Save lbugnion/31e78d57712c45262a30bd0c661586f3 to your computer and use it in GitHub Desktop.
Save lbugnion/31e78d57712c45262a30bd0c661586f3 to your computer and use it in GitHub Desktop.
private CustomVisionPredictionClient _endpoint;
// ...
if (_endpoint == null)
{
_endpoint = new CustomVisionPredictionClient
{
ApiKey = App.PredictionKey // PredictionKey copied from the CustomVision.ai project
};
}
// ...
IEnumerable<PredictionModel> tags = null;
using (var stream = file.GetStream())
{
tags = _endpoint.ClassifyImage(App.ProjectGuid, "Iteration2", stream)
.Predictions
.OrderByDescending(p => p.Probability);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment