コード例 #1
0
        public void PredictImageUrlNoStore()
        {
            string testImageUrl = "https://raw.githubusercontent.com/Microsoft/Cognitive-CustomVision-Windows/master/Samples/Images/Test/test_image.jpg";

            using (MockContext context = MockContext.Start(this.GetType().Name))
            {
                HttpMockServer.Initialize(this.GetType().Name, "PredictImageUrlNoStore", RecorderMode);

                ICustomVisionPredictionClient client = GetPredictionClientClient();
                ImageUrl url = new ImageUrl(testImageUrl);

                ImagePrediction results = client.PredictImageUrlWithNoStoreAsync(ProjectId, url).Result;
                ValidateResults(results);
            }
        }
コード例 #2
0
 /// <summary>
 /// Predict an image url without saving the result
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='projectId'>
 /// The project id
 /// </param>
 /// <param name='imageUrl'>
 /// An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be
 /// evaluated
 /// </param>
 /// <param name='iterationId'>
 /// Optional. Specifies the id of a particular iteration to evaluate against.
 /// The default iteration for the project will be used when not specified
 /// </param>
 /// <param name='application'>
 /// Optional. Specifies the name of application using the endpoint
 /// </param>
 public static ImagePrediction PredictImageUrlWithNoStore(this ICustomVisionPredictionClient operations, System.Guid projectId, ImageUrl imageUrl, System.Guid?iterationId = default(System.Guid?), string application = default(string))
 {
     return(operations.PredictImageUrlWithNoStoreAsync(projectId, imageUrl, iterationId, application).GetAwaiter().GetResult());
 }