예제 #1
0
        public async Task <Microsoft.ProjectOxford.Face.Contract.Face[]> DetectWithClientAsync(Stream imageStream)
        {
            var client = new Microsoft.ProjectOxford.Face.FaceServiceClient(SubscriptionKeys.FaceId);

            return(await client.DetectAsync(imageStream,
                                            returnFaceId : true,
                                            returnFaceLandmarks : true,
                                            returnFaceAttributes : new [] {
                Microsoft.ProjectOxford.Face.FaceAttributeType.Age,
                Microsoft.ProjectOxford.Face.FaceAttributeType.Gender
            }));
        }
예제 #2
0
        public FaceTest()
        {
            Configuration = new ConfigurationBuilder()
                            .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\", "ProfileManager.Web"))
                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                            .AddJsonFile("appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true)
                            .Build();

            _fakeHttpHandler = new Mock <FakeHttpMessageHandler>()
            {
                CallBase = true
            };
            _fakeHttpClient = new HttpClient(_fakeHttpHandler.Object);
            _realHttpClient = new HttpClient();

            _options = Options.Create(new FaceInfoProviderOptions()
            {
                Endpoint = Configuration["FaceInfoProvider:Endpoint"], Key = Configuration["FaceInfoProvider:Key"]
            });
            _faceClient = new Microsoft.ProjectOxford.Face.FaceServiceClient(_options.Value.Key);
        }
예제 #3
0
 public FaceCaller()
 {
     _client = new Microsoft.ProjectOxford.Face.FaceServiceClient(subscriptionKey);
 }