private static async Task ApplyPredictionToBlob(IStorageService storageService, string name, PredictionResponse response) { var metadata = CreateMetadata(response); await WriteMetadataToFile(storageService, name, metadata); }
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)); }
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) } }); }