Esempio n. 1
0
        private static async Task ApplyPredictionToBlob(IStorageService storageService,
                                                        string name,
                                                        PredictionResponse response)
        {
            var metadata = CreateMetadata(response);

            await WriteMetadataToFile(storageService, name, metadata);
        }
Esempio n. 2
0
        private static string GetMetaDataFromPrediction(PredictionResponse response)
        {
            var predictionDetail = response.Predictions
                                   .Select(x => new { tag = x.TagName, probability = Math.Round(x.Probability, 4) })
                                   .ToArray();

            return(JsonConvert.SerializeObject(predictionDetail));
        }
Esempio n. 3
0
 private static IDictionary <string, string> CreateMetadata(PredictionResponse response)
 {
     return(new Dictionary <string, string>
     {
         {
             Common.Constants.ImageMetadataKeys.ClassificationStatus,
             Common.ImageClassificationStatus.Completed.ToString()
         },
         {
             Common.Constants.ImageMetadataKeys.PredictionDetail,
             GetMetaDataFromPrediction(response)
         }
     });
 }