Я пытаюсь заставить Google Vision API работать с моим проектом, но у меня возникают проблемы.Я получаю следующую ошибку:
Grpc.Core.RpcException: 'Status (StatusCode = PermissionDenied, Detail = "Этот метод API требует, чтобы биллинг был включен
Я создал учетную запись службы, биллинг включен, и у меня есть файл .json. У меня есть переменная окружения для моего аккаунта для GOOGLE_APPLICATION_CREDENTIALS, указывающая на файл .json.
Мне еще предстоит найти решение моей проблемы с помощью Googleдокументация или проверка StackOverFlow.
using Google.Cloud.Vision.V1;
using System;
using System.Collections.Generic;
namespace Vision
{
internal static class GoogleVision
{
public static EntityAnnotation[] GetAnnotations(EventManager em, string filePath, string EventNr)
{
{
ImageAnnotatorClient Client = ImageAnnotatorClient.Create();
Image Image = Google.Cloud.Vision.V1.Image.FromFile(filePath);
IReadOnlyList<EntityAnnotation> Response = Client.DetectLabels(Image);
EntityAnnotation[] annotations = new EntityAnnotation[Response.Count];
for (int i = 0; i < annotations.Length; i++)
{
annotations[i] = Response[i];
}
return annotations;
}
}
}
}