【发布时间】:2017-08-28 20:15:26
【问题描述】:
我想使用 Google Vision API 进行标签检测。为此,我正在使用 .NET 库。这是我的代码:
var client = ImageAnnotatorClient.Create();
// Load the image file into memory
var image = Image.FromFile("trui3.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);
}
Console.ReadKey();
效果很好。它显示所有标签。但在 Google website 上,它还显示标签的百分比。示例请参见图片。
如何使用 .NET 库来实现这一点?
【问题讨论】: