I've create a custom vision project to recognise characters (A, B, C...). What is interesting: if I upload an image of a character (in this case an "N") to the vision API portal it will tell me that it is 99.9% sure it is an "N":
If however I use the client libraries to predict the very same image, I'm getting 53% that it is a "W" and only 37% that it is an "N":
- I double checked that the latest iteration is the published one
- I double checked that I'm using the correct project ID
- My endpoint is set to "https://westeurope.api.cognitive.microsoft.com" in the
CustomVisionPredictionClient
The code to get the prediction on my client:
var client = new CustomVisionPredictionClient()
{
ApiKey = predictionKey,
Endpoint = endpoint
};
var result = await client.PredictImageAsync(Guid.Parse(projectId), imageStream).ConfigureAwait(false);
var prediction = result.Predictions.FirstOrDefault();
Where does this difference come from and how to fix because according to the tests I did by uploading images the results are close to 100% correct no matter which character image I upload?
UPDATE: I noticed that there was an update for the client libraries. They went from 0.12pre to 1.0stable. After the update the PredictImageAsync
is gone and replaced with DetectImageAsync
. This expected as an additional parameter a model name. I tried using the name of the iteration and after a while the method returns with an internal server error. So not sure what to try next.