Google Cloud API not returning any response dotnet lib

46 Views Asked by At
string modelId = "";
var client = await ImageAnnotatorClient.CreateAsync(stoppingToken);
var image = Google.Cloud.Vision.V1.Image.FromFile(@"C:\Screenshot_3.jpg");

var request = new AnnotateImageRequest
{

    Image = image,
    Features =
    {
        new Feature
        {
            Type = Feature.Types.Type.ObjectLocalization,
            Model = modelId
        }
    }
};

var response = await client.AnnotateAsync(request);
string result = string.Empty;
foreach (var annotation in response.LocalizedObjectAnnotations)
{
    if (annotation.Name != null)
    {
        result += $"{annotation.Name} ";
    }
}

after AnnotateAsync result: response is null or {} empty object I take model id from Google console as in the screenshot

what am I missing?

Feature Type Feature.Types.Type.ObjectLocalization coincides with Objective in the screenshot enter image description here

I convey this picture more accurately than its correct code

0

There are 0 best solutions below