0

I am going to compare some emotion detection applications. I want to design a simple C# application to test emotion for large number of images using build-in code or built-in libraries. Can we download c# code for emotion detection from google cloud api?

Salik
  • 11
  • 3
  • Is this what you are looking for? https://cloud.google.com/vision/. I doubt they will have anything for you in C# though. It seems to be all cloud based using web APIs. It should be possible to create a C# wrapper though (*possible*, not easy). – Bradley Uffner Nov 10 '16 at 20:49
  • Apparently I was wrong. They provide a C# wrapper already. Check under "Client libraries" on the left side of this page https://cloud.google.com/vision/reference/rest/ Here is a convenient Nuget package too https://www.nuget.org/packages/Google.Apis.Vision.v1/ – Bradley Uffner Nov 10 '16 at 20:53

1 Answers1

0

Yes, you can. It has two ways either parse json response or you can use following method of native c# code. For more detail visit https://cloud.google.com/vision/docs/libraries#client-libraries-usage-csharp

using Google.Cloud.Vision.V1;
using System;

namespace GoogleCloudSamples
{
    public class QuickStart
    {
        public static void Main(string[] args)
        {
            // Instantiates a client
            var client = ImageAnnotatorClient.Create();
            // 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);
            }
        }
    }
}