![](/img/trans.png)
[英]google vision -convert from google.cloud.vision.v1.entity anotation to json in c#
[英]How to connect with google cloud vision API in c# with JSON file
如何將JSON文件與c# windows應用程序連接,並與谷歌雲視覺連接從圖像中讀取文本?
我相信您應該使用與文檔類似的內容:
using Google.Cloud.Vision.V1;
using System;
namespace GoogleCloudSamples
{
public class QuickStart
{
public static void Main(string[] args)
{
// jsonPath is the path to the key.json file
var credential = GoogleCredential.FromFile(jsonPath);
// Instantiates a client
var client = ImageAnnotatorClient.Create(credential);
// Load the image file into memory
var image = Image.FromFile("wakeupcat.jpg");
// Performs label detection on the image file
var response = client.DetectLabels(image);
foreach (var annotation in response)
{
if (annotation.Description != null)
Console.WriteLine(annotation.Description);
}
}
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.