CustomVisionPredictionClient reporting incorrect BoundingBox dimensions

Bob Crowley 50 Reputation points
2024-01-29T15:24:45.9+00:00

I am using Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction 2.0.0 package to perform custom vision predictions. It succeeds, except the detected bounding boxes are reporting WAY too small, like fractions of a pixel in size. When I do a quick test of my model on https://www.customvision.ai it appears to work as intended but in my application I get bad results.User's image

 var predictionResultTask = customClient.DetectImageUrlAsync(VisionConfiguration.PredictionProject, VisionConfiguration.ObjDetectionModelName, imgUrl);

 var resultTask = imgClient.AnalyzeAsync(imageContent: imgUri, visualFeatures: VisualFeatures.Read | VisualFeatures.Tags);

 await Task.WhenAll(predictionResultTask, resultTask);

 var ocrResult = resultTask.Result.Value;
 var predictionResult = predictionResultTask.Result; // <-- this is the result I'm looking at


User's image

Azure AI Custom Vision
Azure AI Custom Vision
An Azure artificial intelligence service and end-to-end platform for applying computer vision to specific domains.
249 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bob Crowley 50 Reputation points
    2024-01-29T16:33:48.73+00:00

    Those values are a percentage of the original image size so there is no actual problem. I'll leave this question here in case someone is as dumb as me.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.