示例#1
0
 /// <summary>
 /// Classify an image 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='publishedName'>
 /// Specifies the name of the model to evaluate against.
 /// </param>
 /// <param name='imageData'>
 /// Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports
 /// images up to 4MB.
 /// </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 <ImagePrediction> ClassifyImageAsync(this ICustomVisionPredictionClient operations, System.Guid projectId, string publishedName, Stream imageData, string application = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ClassifyImageWithHttpMessagesAsync(projectId, publishedName, imageData, application, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#2
0
 /// <summary>
 /// Classify an image 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='publishedName'>
 /// Specifies the name of the model to evaluate against.
 /// </param>
 /// <param name='imageData'>
 /// Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports
 /// images up to 4MB.
 /// </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 <ImagePrediction> ClassifyImageWithHttpMessages(this ICustomVisionPredictionClient operations, System.Guid projectId, string publishedName, Stream imageData, string application = default(string), Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.ClassifyImageWithHttpMessagesAsync(projectId, publishedName, imageData, application, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }