Images - Create Regions
此 API 接受一批映像区域(可选)以使用区域信息更新现有映像。 批处理中有 64 个条目的限制。 如果所有区域都成功创建,将返回 200(OK) 状态代码。 否则,将返回 207(多状态)状态代码,并且每个区域的详细信息状态将列在响应有效负载中。
POST {Endpoint}/customvision/v3.3/training/projects/{projectId}/images/regions
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
Endpoint
|
path | True |
string |
支持的认知服务终结点。 |
|
project
|
path | True |
string (uuid) |
项目 ID。 |
请求头
Media Types: "application/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| Training-Key | True |
string |
请求正文
Media Types: "application/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"
| 名称 | 类型 | 说明 |
|---|---|---|
| regions |
将区域关联到图像的条目。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
还行 Media Types: "application/json", "application/xml", "text/xml" |
|
| Other Status Codes |
207 Media Types: "application/json", "application/xml", "text/xml" |
|
| Other Status Codes |
错误响应 Media Types: "application/json", "application/xml", "text/xml" |
安全性
Training-Key
类型:
apiKey
在:
header
示例
Successful CreateImageRegions request
示例请求
POST https://westus.api.cognitive.microsoft.com/customvision/v3.3/training/projects/bc3f7dad-5544-468c-8573-3ef04d55463e/images/regions
{
"regions": [
{
"imageId": "4d6eb844-42ee-42bc-bd6f-c32455ef07c9",
"tagId": "b607964f-7bd6-4a3b-a869-6791fb6aab87",
"left": 0.25,
"top": 0.25,
"width": 0.25,
"height": 0.25
},
{
"imageId": "4d6eb844-42ee-42bc-bd6f-c32455ef07c9",
"tagId": "b607964f-7bd6-4a3b-a869-6791fb6aab87",
"left": 0.35,
"top": 0.35,
"width": 0.25,
"height": 0.25
}
]
}
示例响应
{
"created": [
{
"imageId": "4d6eb844-42ee-42bc-bd6f-c32455ef07c9",
"tagId": "b607964f-7bd6-4a3b-a869-6791fb6aab87",
"left": 0.25,
"top": 0.25,
"width": 0.25,
"height": 0.25
},
{
"imageId": "4d6eb844-42ee-42bc-bd6f-c32455ef07c9",
"tagId": "b607964f-7bd6-4a3b-a869-6791fb6aab87",
"left": 0.35,
"top": 0.35,
"width": 0.25,
"height": 0.25
}
],
"duplicated": [],
"exceeded": []
}
{
"created": [
{
"imageId": "4d6eb844-42ee-42bc-bd6f-c32455ef07c9",
"tagId": "b607964f-7bd6-4a3b-a869-6791fb6aab87",
"left": 0.25,
"top": 0.25,
"width": 0.25,
"height": 0.25
}
],
"duplicated": [],
"exceeded": [
{
"imageId": "4d6eb844-42ee-42bc-bd6f-c32455ef07c9",
"tagId": "b607964f-7bd6-4a3b-a869-6791fb6aab87",
"left": 0.35,
"top": 0.35,
"width": 0.25,
"height": 0.25
}
]
}
定义
| 名称 | 说明 |
|---|---|
|
Custom |
|
|
Custom |
错误代码。 |
|
Image |
要创建的一批映像区域信息。 |
|
Image |
将区域关联到图像的条目。 |
|
Image |
|
|
Image |
CustomVisionError
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
错误代码。 |
|
| message |
string |
说明服务报告的错误的消息。 |
CustomVisionErrorCodes
错误代码。
| 值 | 说明 |
|---|---|
| NoError | |
| BadRequest | |
| BadRequestExceededBatchSize | |
| BadRequestNotSupported | |
| BadRequestInvalidIds | |
| BadRequestProjectName | |
| BadRequestProjectNameNotUnique | |
| BadRequestProjectDescription | |
| BadRequestProjectUnknownDomain | |
| BadRequestProjectUnknownClassification | |
| BadRequestProjectUnsupportedDomainTypeChange | |
| BadRequestProjectUnsupportedExportPlatform | |
| BadRequestProjectImagePreprocessingSettings | |
| BadRequestProjectDuplicated | |
| BadRequestIterationName | |
| BadRequestIterationNameNotUnique | |
| BadRequestIterationDescription | |
| BadRequestIterationIsNotTrained | |
| BadRequestIterationValidationFailed | |
| BadRequestWorkspaceCannotBeModified | |
| BadRequestWorkspaceNotDeletable | |
| BadRequestTagName | |
| BadRequestTagNameNotUnique | |
| BadRequestTagDescription | |
| BadRequestTagType | |
| BadRequestMultipleNegativeTag | |
| BadRequestMultipleGeneralProductTag | |
| BadRequestImageTags | |
| BadRequestImageRegions | |
| BadRequestNegativeAndRegularTagOnSameImage | |
| BadRequestUnsupportedDomain | |
| BadRequestRequiredParamIsNull | |
| BadRequestIterationIsPublished | |
| BadRequestInvalidPublishName | |
| BadRequestInvalidPublishTarget | |
| BadRequestUnpublishFailed | |
| BadRequestIterationNotPublished | |
| BadRequestSubscriptionApi | |
| BadRequestExceedProjectLimit | |
| BadRequestExceedIterationPerProjectLimit | |
| BadRequestExceedTagPerProjectLimit | |
| BadRequestExceedTagPerImageLimit | |
| BadRequestExceededQuota | |
| BadRequestCannotMigrateProjectWithName | |
| BadRequestNotLimitedTrial | |
| BadRequestImageBatch | |
| BadRequestImageStream | |
| BadRequestImageUrl | |
| BadRequestImageFormat | |
| BadRequestImageSizeBytes | |
| BadRequestImageDimensions | |
| BadRequestImageExceededCount | |
| BadRequestTrainingNotNeeded | |
| BadRequestTrainingNotNeededButTrainingPipelineUpdated | |
| BadRequestTrainingValidationFailed | |
| BadRequestClassificationTrainingValidationFailed | |
| BadRequestMultiClassClassificationTrainingValidationFailed | |
| BadRequestMultiLabelClassificationTrainingValidationFailed | |
| BadRequestDetectionTrainingValidationFailed | |
| BadRequestTrainingAlreadyInProgress | |
| BadRequestDetectionTrainingNotAllowNegativeTag | |
| BadRequestInvalidEmailAddress | |
| BadRequestDomainNotSupportedForAdvancedTraining | |
| BadRequestExportPlatformNotSupportedForAdvancedTraining | |
| BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining | |
| BadRequestExportValidationFailed | |
| BadRequestExportAlreadyInProgress | |
| BadRequestPredictionIdsMissing | |
| BadRequestPredictionIdsExceededCount | |
| BadRequestPredictionTagsExceededCount | |
| BadRequestPredictionResultsExceededCount | |
| BadRequestPredictionInvalidApplicationName | |
| BadRequestPredictionInvalidQueryParameters | |
| BadRequestInvalidImportToken | |
| BadRequestExportWhileTraining | |
| BadRequestImageMetadataKey | |
| BadRequestImageMetadataValue | |
| BadRequestOperationNotSupported | |
| BadRequestInvalidArtifactUri | |
| BadRequestCustomerManagedKeyRevoked | |
| BadRequestInvalid | |
| UnsupportedMediaType | |
| Forbidden | |
| ForbiddenUser | |
| ForbiddenUserResource | |
| ForbiddenUserSignupDisabled | |
| ForbiddenUserSignupAllowanceExceeded | |
| ForbiddenUserDoesNotExist | |
| ForbiddenUserDisabled | |
| ForbiddenUserInsufficientCapability | |
| ForbiddenDRModeEnabled | |
| ForbiddenInvalid | |
| NotFound | |
| NotFoundProject | |
| NotFoundProjectDefaultIteration | |
| NotFoundIteration | |
| NotFoundIterationPerformance | |
| NotFoundTag | |
| NotFoundImage | |
| NotFoundDomain | |
| NotFoundApimSubscription | |
| NotFoundInvalid | |
| Conflict | |
| ConflictInvalid | |
| ErrorUnknown | |
| ErrorIterationCopyFailed | |
| ErrorPreparePerformanceMigrationFailed | |
| ErrorProjectInvalidWorkspace | |
| ErrorProjectInvalidPipelineConfiguration | |
| ErrorProjectInvalidDomain | |
| ErrorProjectTrainingRequestFailed | |
| ErrorProjectImportRequestFailed | |
| ErrorProjectExportRequestFailed | |
| ErrorFeaturizationServiceUnavailable | |
| ErrorFeaturizationQueueTimeout | |
| ErrorFeaturizationInvalidFeaturizer | |
| ErrorFeaturizationAugmentationUnavailable | |
| ErrorFeaturizationUnrecognizedJob | |
| ErrorFeaturizationAugmentationError | |
| ErrorExporterInvalidPlatform | |
| ErrorExporterInvalidFeaturizer | |
| ErrorExporterInvalidClassifier | |
| ErrorPredictionServiceUnavailable | |
| ErrorPredictionModelNotFound | |
| ErrorPredictionModelNotCached | |
| ErrorPrediction | |
| ErrorPredictionStorage | |
| ErrorRegionProposal | |
| ErrorUnknownBaseModel | |
| ErrorInvalid |
ImageRegionCreateBatch
要创建的一批映像区域信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| regions |
将区域关联到图像的条目。 |
ImageRegionCreateEntry
将区域关联到图像的条目。
| 名称 | 类型 | 说明 |
|---|---|---|
| height |
number (float) |
高度。 |
| imageId |
string (uuid) |
图像的 ID。 |
| left |
number (float) |
左边界的坐标。 |
| tagId |
string (uuid) |
与此区域关联的标记的 ID。 |
| top |
number (float) |
顶边界的坐标。 |
| width |
number (float) |
宽度。 |
ImageRegionCreateResult
| 名称 | 类型 | 说明 |
|---|---|---|
| created |
string (date-time) |
|
| height |
number (float) |
高度。 |
| imageId |
string (uuid) |
|
| left |
number (float) |
左边界的坐标。 |
| regionId |
string (uuid) |
|
| tagId |
string (uuid) |
与此区域关联的标记的 ID。 |
| tagName |
string |
|
| top |
number (float) |
顶边界的坐标。 |
| width |
number (float) |
宽度。 |
ImageRegionCreateSummary
| 名称 | 类型 | 说明 |
|---|---|---|
| created | ||
| duplicated |
将区域关联到图像的条目。 |
|
| exceeded |
将区域关联到图像的条目。 |