你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CustomVisionTrainingClient.CreateImagesFromDataWithHttpMessagesAsync 方法

定义

将提供的图像添加到训练图像集。

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.Models.ImageCreateSummary>> CreateImagesFromDataWithHttpMessagesAsync (Guid projectId, System.IO.Stream imageData, System.Collections.Generic.IList<Guid> tagIds = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateImagesFromDataWithHttpMessagesAsync : Guid * System.IO.Stream * System.Collections.Generic.IList<Guid> * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.Models.ImageCreateSummary>>
override this.CreateImagesFromDataWithHttpMessagesAsync : Guid * System.IO.Stream * System.Collections.Generic.IList<Guid> * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.Models.ImageCreateSummary>>
Public Function CreateImagesFromDataWithHttpMessagesAsync (projectId As Guid, imageData As Stream, Optional tagIds As IList(Of Guid) = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of ImageCreateSummary))

参数

projectId
Guid

项目 ID。

imageData
Stream

二进制图像数据。 支持的格式为 JPEG、GIF、PNG 和 BMP。 支持最大 6MB 的映像。

tagIds
IList<Guid>

用于标记每个图像的标记 ID。 限制为 20。

customHeaders
Dictionary<String,List<String>>

将添加到请求的标头。

cancellationToken
CancellationToken

取消标记。

返回

实现

例外

当操作返回无效状态代码时引发

无法反序列化响应时引发

当所需参数为 null 时引发

当所需参数为 null 时引发

注解

此 API 接受 multipart/form-data 和 application/octet-stream 形式的正文内容。 使用多部分时,可以一次发送多个图像文件,最多 64 个文件

适用于