2017-08-28 1 views
0

ラベル検出にGoogle Vision APIを使用したいと考えています。このため私は.NETライブラリを使用しています。これは私のコードです:Google Vision APIからラベル率を取得

 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ライブラリを使用してこれを実現するにはどうすればよいですか?

Vision API from Google website.

答えて

0

注釈は[0,1]の範囲内Scoreを(C# example pageさらに下を参照)を有します。

if (annotation.Description != null) 
{ 
    Console.WriteLine($"{annotation.Description} ({annotation.Score}"); 
} 
関連する問題