@Deepankar Thanks for getting back. I tried with the below sample using SDK and it worked fine.
using Azure;
using Azure.AI.Vision.ImageAnalysis;
private static readonly string key = "AJOJLXXXXXXXXCOGSb9F";
private static readonly string endpoint = "https://XXX.cognitiveservices.azure.com/";
ImageAnalysisClient client = new ImageAnalysisClient(
new Uri(endpoint),
new AzureKeyCredential(key));
ImageAnalysisResult result = client.Analyze(
new Uri("https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"),
VisualFeatures.Caption | VisualFeatures.Read,
new ImageAnalysisOptions { GenderNeutralCaption = true });
Console.WriteLine("Image analysis results:");
Console.WriteLine(" Caption:");
Console.WriteLine($" '{result.Caption.Text}', Confidence {result.Caption.Confidence:F4}");
Console.WriteLine(" Read:");
foreach (DetectedTextBlock block in result.Read.Blocks)
foreach (DetectedTextLine line in block.Lines)
{
Console.WriteLine($" Line: '{line.Text}', Bounding Polygon: [{string.Join(" ", line.BoundingPolygon)}]");
foreach (DetectedTextWord word in line.Words)
{
Console.WriteLine($" Word: '{word.Text}', Confidence {word.Confidence.ToString("#.####")}, Bounding Polygon: [{string.Join(" ", word.BoundingPolygon)}]");
}
}
.
If you wish to make your application work only with the REST API, then please try with the api-version
and 2023-10-01
.
Hope this helps.