public async Task DescribeAsync()
        {
            try
            {
                if (this.ImageUrl != null)
                {
                    this.ImageDescription = await VisionServiceHelper.DescribeAsync(this.ImageUrl);

                    this.AnalysisResult = GetAnalysisResult(this.ImageDescription);
                }
                else if (this.GetImageStreamCallback != null)
                {
                    this.ImageDescription = await VisionServiceHelper.DescribeAsync(this.GetImageStreamCallback);

                    this.AnalysisResult = GetAnalysisResult(this.ImageDescription);
                }
            }
            catch (Exception e)
            {
                ErrorTrackingHelper.TrackException(e, "Vision API DescribeAsync error");

                this.AnalysisResult = new ImageAnalysis();

                if (this.ShowDialogOnFaceApiErrors)
                {
                    await ErrorTrackingHelper.GenericApiCallExceptionHandler(e, "Vision API failed.");
                }
            }
        }
Пример #2
0
        public async Task DescribeAsync()
        {
            try
            {
                if (this.ImageUrl != null)
                {
                    this.AnalysisResult = await VisionServiceHelper.DescribeAsync(this.ImageUrl);
                }
                else if (this.GetImageStreamCallback != null)
                {
                    this.AnalysisResult = await VisionServiceHelper.DescribeAsync(this.GetImageStreamCallback);
                }
            }
            catch (Exception e)
            {
                this.AnalysisResult = new Microsoft.ProjectOxford.Vision.Contract.AnalysisResult();

                if (this.ShowDialogOnFaceApiErrors)
                {
                    await ErrorTrackingHelper.GenericApiCallExceptionHandler(e, "Vision API failed.");
                }
            }
        }