Esempio n. 1
0
        public void Handle(FaceAttributesResultEvent message)
        {
            var faceAttributes = message.FaceAttributesResult;

            AssignFaceAttributes(faceAttributes);

            var age = faceAttributes.Age;

            _faceService.AddAgeToStatistics(age);

            var averageAge = _faceService.CalculateAverageAge();

            AssignAverageAge(averageAge);

            var emotionScores = faceAttributes.Emotion;

            GenerateAndPopulateEmotionBar(emotionScores);
            _emotionService.AddEmotionScoresToStatistics(emotionScores);

            var emotionScoresStatistics = _emotionService.CalculateEmotionScoresStatistics();

            AssignEmotionStatistics(emotionScoresStatistics);

            var hairColors = faceAttributes.Hair.HairColor;

            GenerateHairColor(hairColors);

            var faceAPICallCount = _faceService.GetFaceServiceClientAPICallCount();

            AssignFaceAPICallCount(faceAPICallCount);
        }