是否可以使用Google.Cloud.Vision检测性别

时间:2019-12-12 12:05:01

标签: c# google-cloud-platform

我找到了一些检测人脸的代码示例:

 var image = Image.FromFile(filePath);
        var client = ImageAnnotatorClient.Create();
        var response = client.DetectFaces(image);
        int count = 1;
        foreach (var faceAnnotation in response)
        {
            Console.WriteLine("Face {0}:", count++);
            Console.WriteLine("  Joy: {0}", faceAnnotation.JoyLikelihood);

            Console.WriteLine("  Anger: {0}", faceAnnotation.AngerLikelihood);
            Console.WriteLine("  Sorrow: {0}", faceAnnotation.SorrowLikelihood);
            Console.WriteLine("  Surprise: {0}", faceAnnotation.SurpriseLikelihood);
        }

但是我在faceAnnotation中找不到'IsMale'或'Gender'属性。如何使用Google.Cloud.Vision检测性别?

1 个答案:

答案 0 :(得分:1)

我认为AWS Rekognition可以提供性别:

问:我可以从Amazon Rekognition获得哪些面部属性?

Amazon Rekognition为检测到的每个面部返回以下面部属性,以及每个属性的边界框和置信度得分:

  1. 性别
  2. 微笑 ...

请参阅:https://aws.amazon.com/rekognition/faqs/