Exemple #1
0
        public void PredictImageNoStore()
        {
            using (MockContext context = MockContext.Start(this.GetType().Name))
            {
                HttpMockServer.Initialize(this.GetType().Name, "PredictImageNoStore", RecorderMode);

                ICustomVisionPredictionClient client = GetPredictionClientClient();
                using (FileStream stream = new FileStream(Path.Combine("TestImages", "test_image.jpg"), FileMode.Open))
                {
                    ImagePrediction results = client.PredictImageWithNoStoreAsync(ProjectId, stream).Result;
                    ValidateResults(results);
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Predict an image 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='imageData'>
 /// </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 PredictImageWithNoStore(this ICustomVisionPredictionClient operations, System.Guid projectId, Stream imageData, System.Guid?iterationId = default(System.Guid?), string application = default(string))
 {
     return(operations.PredictImageWithNoStoreAsync(projectId, imageData, iterationId, application).GetAwaiter().GetResult());
 }