Beispiel #1
0
 /// <summary>
 /// Predict an image url and saves 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>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ImagePredictionResultModel> PredictImageUrlAsync(this IPredictionEndpoint operations, System.Guid projectId, ImageUrl imageUrl, System.Guid?iterationId = default(System.Guid?), string application = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PredictImageUrlWithHttpMessagesAsync(projectId, imageUrl, iterationId, application, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 public static async Task <ImagePrediction> PredictImageWithRetryAsync(this IPredictionEndpoint predictionApi, Guid projectId, Func <Task <Stream> > imageStreamCallback, Guid iterationId)
 {
     return(await RunTaskWithAutoRetryOnQuotaLimitExceededError <ImagePrediction>(async() => await predictionApi.PredictImageAsync(projectId, await imageStreamCallback(), iterationId)));
 }
 public static async Task <ImagePrediction> PredictImageUrlWithRetryAsync(this IPredictionEndpoint predictionApi, Guid projectId, ImageUrl imageUrl, Guid iterationId)
 {
     return(await RunTaskWithAutoRetryOnQuotaLimitExceededError <ImagePrediction>(async() => await predictionApi.PredictImageUrlAsync(projectId, imageUrl, iterationId)));
 }
Beispiel #4
0
 private static SinglePredictorWithPredictionsToFile ConstructPredictor(IPredictionEndpoint predictionEndpoint, string predictionFilePath, TimeSpan milliSecondsBetweenPrediction)
 {
     return(new SinglePredictorWithPredictionsToFile(
                new SinglePredictorWithConsoleOutput(new SinglePredictorWithRetry(new SinglePredictor(predictionEndpoint), milliSecondsBetweenPrediction)), predictionFilePath));
 }
Beispiel #5
0
 public SinglePredictor(IPredictionEndpoint predictionEndpoint)
 {
     PredictionEndpoint = predictionEndpoint;
 }
Beispiel #6
0
 /// <summary>
 /// Predict an image url and saves 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 ImagePredictionResultModel PredictImageUrl(this IPredictionEndpoint operations, System.Guid projectId, ImageUrl imageUrl, System.Guid?iterationId = default(System.Guid?), string application = default(string))
 {
     return(operations.PredictImageUrlAsync(projectId, imageUrl, iterationId, application).GetAwaiter().GetResult());
 }
Beispiel #7
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>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static HttpOperationResponse <ImagePredictionResultModel> PredictImageWithNoStoreWithHttpMessages(this IPredictionEndpoint operations, System.Guid projectId, Stream imageData, System.Guid?iterationId = default(System.Guid?), string application = default(string), Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.PredictImageWithNoStoreWithHttpMessagesAsync(projectId, imageData, iterationId, application, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
Beispiel #8
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 ImagePredictionResultModel PredictImageWithNoStore(this IPredictionEndpoint 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());
 }