I am trying to get a very simple c# snippet on predicting an image, but get following error (there is very little on the internet around this subject):
Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction.Models.CustomVisionErrorException HResult=0x80131500 Message=Operation returned an invalid status code 'NotFound'
var predictionClient = GetPredictionClient();
predictionClient.ClassifyImageUrl(Guid.Parse("5329678e-2a6b-46cf-ac11-fbd19ce89353"), "Iteration2", new ImageUrl("https://storageinfluencer.blob.core.windows.net/social-media-images/1e8bfef3-f070-44b9-9ae4-4b0d8a31316d.jpg"));
CustomVisionPredictionClient GetPredictionClient()
{
CustomVisionPredictionClient endpoint = new CustomVisionPredictionClient()
{
ApiKey = "xxx",
Endpoint = "https://northeurope.api.cognitive.microsoft.com/customvision/v3.0/Prediction/"
};
return endpoint;
}
I got a little closer by using fiddler. EndPoint should be https://northeurope.api.cognitive.microsoft.com only even if portal says copy the other as end point. However now I get:
{"code":"BadRequest","message":"Invalid project type for operation."}
I have following POST in fiddler: