Is there a way to get values with low confidence for objects found in pictures using Microsoft Azure Cognitive Services ComputerVision?

Viewed 67

I'm using the Microsoft.Azure.CognitiveServices.Vision.ComputerVision API to detect glasses in pictures. If glasses are detected I get pixel coordinates and a confidence value which I noticed is always above 0.5. So I’m trying to get a return value even if the confidence is below that (so even if the API isn't confident enough that there are glasses in the picture). The method to analyze the picture looks like this:

public static async Task AnalyzeImageUrl(ComputerVisionClient client, string imageUrl)
{
    // Creating a list that defines the features to be extracted from the image. 
    var features = new List<VisualFeatureTypes?>
    {
        VisualFeatureTypes.Objects
    };
    Console.WriteLine("Analyzing objects in image...");
    Console.WriteLine();
    // Analyze the URL image 
    var results = await client.AnalyzeImageAsync(imageUrl, features);
    Console.WriteLine("Objects:");
    foreach (var obj in results.Objects)
    {
        Console.WriteLine(@$"{obj.ObjectProperty} with confidence {obj.Confidence} at 
            location {obj.Rectangle.X}, {obj.Rectangle.X + obj.Rectangle.W}, {obj.Rectangle.Y}, {obj.Rectangle.Y + obj.Rectangle.H}");
    }
}
1 Answers

If you are mentioning the API. I am sorry there are some limitations. It's important to note the limitations of object detection so you can avoid or mitigate the effects of false negatives (missed objects) and limited detail.

Objects are generally not detected if they're small (less than 5% of the image). Objects are generally not detected if they're arranged closely together (a stack of plates, for example). Objects are not differentiated by brand or product names (different types of sodas on a store shelf, for example). However, you can get brand information from an image by using the Brand detection feature.

Those low score results will not return. Is there any scenario you need the low score results? I can let the product group know so that we may optimize the corner case. Thanks.

Related