예제 #1
0
 private async void OnAnalysisByEmotionAPI(object sender, RoutedEventArgs e)
 {
     VideoOperationResult videoResult = null;
     byte[] data = UtilityHelper.StreamToByteAraray(fileStream.AsStreamForRead());
     string key = "";
     EmotionAPIService api = new EmotionAPIService(key);
     api.VideoAnalysisProgressChanged += Api_VideoAnalysisProgressChanged;
     api.VideoAnalysisSuccessed += Api_VideoAnalysisSuccessed;
     videoResult = await api.RecognizeVideo(data.AsBuffer(), string.Empty);
 }
예제 #2
0
 private async void OnAnalysisByEmotionAPI(object sender, RoutedEventArgs e)
 {
     string key = "";
     //file straem to byte array
     byte[] data = UtilityHelper.StreamToByteAraray(fileStream);
     EmotionAPIService api = new EmotionAPIService(key);
     var emoptionResult = await api.Recognize(data.AsBuffer(), string.Empty);
     if (emoptionResult == null)
     {
         MessageDialog dialog = new MessageDialog("failed");
         var task = dialog.ShowAsync();
     }
     else
     {
         AddFaceRectangles(emoptionResult);
     }
 }