Images - Create From Urls
Add the provided images urls to the set of training images. This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. If all images are successful created, 200(OK) status code will be returned. Otherwise, 207 (Multi-Status) status code will be returned and detail status for each image will be listed in the response payload.
POST {Endpoint}/customvision/v3.3/training/projects/{projectId}/images/urls
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
Endpoint
|
path | True |
string |
Supported Cognitive Services endpoints. |
project
|
path | True |
string uuid |
The project id. |
Request Header
Media Types: "application/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"
Name | Required | Type | Description |
---|---|---|---|
Training-Key | True |
string |
Request Body
Media Types: "application/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"
Name | Type | Description |
---|---|---|
images | ||
metadata |
object |
The metadata of image. Limited to 50 key-value pairs per image. The length of key is limited to 256. The length of value is limited to 512. |
tagIds |
string[] |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK Media Types: "application/json", "application/xml", "text/xml" |
|
Other Status Codes |
207 Media Types: "application/json", "application/xml", "text/xml" |
|
Other Status Codes |
Error response Media Types: "application/json", "application/xml", "text/xml" |
Security
Training-Key
Type:
apiKey
In:
header
Examples
Successful CreateImagesFromUrls request
Sample request
POST https://westus.api.cognitive.microsoft.com/customvision/v3.3/training/projects/64b822c5-8082-4b36-a426-27225f4aa18c/images/urls
{
"images": [
{
"url": "{url to image}"
}
],
"tagIds": [
"b607964f-7bd6-4a3b-a869-6791fb6aab87"
]
}
Sample response
{
"isBatchSuccessful": true,
"images": [
{
"sourceUrl": "{url to image}",
"status": "OK",
"image": {
"id": "4d6eb844-42ee-42bc-bd6f-c32455ef07c9",
"created": "2017-12-19T15:56:10Z",
"width": 1095,
"height": 900,
"resizedImageUri": "{Resized Image Uri}",
"originalImageUri": "{Image Uri}",
"thumbnailUri": "{Thumbnail Uri}",
"tags": [
{
"tagId": "b607964f-7bd6-4a3b-a869-6791fb6aab87",
"created": "2017-12-19T15:56:09Z",
"tagName": "tag name"
}
]
}
}
]
}
{
"isBatchSuccessful": false,
"images": [
{
"sourceUrl": "{url to image}",
"status": "OK",
"image": {
"id": "4d6eb844-42ee-42bc-bd6f-c32455ef07c9",
"created": "2017-12-19T15:56:10Z",
"width": 1095,
"height": 900,
"resizedImageUri": "{Resized Image Uri}",
"originalImageUri": "{Image Uri}",
"thumbnailUri": "{Thumbnail Uri}",
"tags": [
{
"tagId": "b607964f-7bd6-4a3b-a869-6791fb6aab87",
"created": "2017-12-19T15:56:09Z",
"tagName": "tag name"
}
]
}
},
{
"sourceUrl": "{url to image}",
"status": "ErrorSource",
"image": null
}
]
}
Definitions
Name | Description |
---|---|
Custom |
|
Custom |
The error code. |
Image |
Image model to be sent as JSON. |
Image |
|
Image |
Status of the image creation. |
Image |
|
Image |
|
Image |
|
Image |
|
Image |
|
Region |
CustomVisionError
Name | Type | Description |
---|---|---|
code |
The error code. |
|
message |
string |
A message explaining the error reported by the service. |
CustomVisionErrorCodes
The error code.
Value | Description |
---|---|
BadRequest | |
BadRequestCannotMigrateProjectWithName | |
BadRequestClassificationTrainingValidationFailed | |
BadRequestCustomerManagedKeyRevoked | |
BadRequestDetectionTrainingNotAllowNegativeTag | |
BadRequestDetectionTrainingValidationFailed | |
BadRequestDomainNotSupportedForAdvancedTraining | |
BadRequestExceedIterationPerProjectLimit | |
BadRequestExceedProjectLimit | |
BadRequestExceedTagPerImageLimit | |
BadRequestExceedTagPerProjectLimit | |
BadRequestExceededBatchSize | |
BadRequestExceededQuota | |
BadRequestExportAlreadyInProgress | |
BadRequestExportPlatformNotSupportedForAdvancedTraining | |
BadRequestExportValidationFailed | |
BadRequestExportWhileTraining | |
BadRequestImageBatch | |
BadRequestImageDimensions | |
BadRequestImageExceededCount | |
BadRequestImageFormat | |
BadRequestImageMetadataKey | |
BadRequestImageMetadataValue | |
BadRequestImageRegions | |
BadRequestImageSizeBytes | |
BadRequestImageStream | |
BadRequestImageTags | |
BadRequestImageUrl | |
BadRequestInvalid | |
BadRequestInvalidArtifactUri | |
BadRequestInvalidEmailAddress | |
BadRequestInvalidIds | |
BadRequestInvalidImportToken | |
BadRequestInvalidPublishName | |
BadRequestInvalidPublishTarget | |
BadRequestIterationDescription | |
BadRequestIterationIsNotTrained | |
BadRequestIterationIsPublished | |
BadRequestIterationName | |
BadRequestIterationNameNotUnique | |
BadRequestIterationNotPublished | |
BadRequestIterationValidationFailed | |
BadRequestMultiClassClassificationTrainingValidationFailed | |
BadRequestMultiLabelClassificationTrainingValidationFailed | |
BadRequestMultipleGeneralProductTag | |
BadRequestMultipleNegativeTag | |
BadRequestNegativeAndRegularTagOnSameImage | |
BadRequestNotLimitedTrial | |
BadRequestNotSupported | |
BadRequestOperationNotSupported | |
BadRequestPredictionIdsExceededCount | |
BadRequestPredictionIdsMissing | |
BadRequestPredictionInvalidApplicationName | |
BadRequestPredictionInvalidQueryParameters | |
BadRequestPredictionResultsExceededCount | |
BadRequestPredictionTagsExceededCount | |
BadRequestProjectDescription | |
BadRequestProjectDuplicated | |
BadRequestProjectImagePreprocessingSettings | |
BadRequestProjectName | |
BadRequestProjectNameNotUnique | |
BadRequestProjectUnknownClassification | |
BadRequestProjectUnknownDomain | |
BadRequestProjectUnsupportedDomainTypeChange | |
BadRequestProjectUnsupportedExportPlatform | |
BadRequestRequiredParamIsNull | |
BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining | |
BadRequestSubscriptionApi | |
BadRequestTagDescription | |
BadRequestTagName | |
BadRequestTagNameNotUnique | |
BadRequestTagType | |
BadRequestTrainingAlreadyInProgress | |
BadRequestTrainingNotNeeded | |
BadRequestTrainingNotNeededButTrainingPipelineUpdated | |
BadRequestTrainingValidationFailed | |
BadRequestUnpublishFailed | |
BadRequestUnsupportedDomain | |
BadRequestWorkspaceCannotBeModified | |
BadRequestWorkspaceNotDeletable | |
Conflict | |
ConflictInvalid | |
ErrorExporterInvalidClassifier | |
ErrorExporterInvalidFeaturizer | |
ErrorExporterInvalidPlatform | |
ErrorFeaturizationAugmentationError | |
ErrorFeaturizationAugmentationUnavailable | |
ErrorFeaturizationInvalidFeaturizer | |
ErrorFeaturizationQueueTimeout | |
ErrorFeaturizationServiceUnavailable | |
ErrorFeaturizationUnrecognizedJob | |
ErrorInvalid | |
ErrorIterationCopyFailed | |
ErrorPrediction | |
ErrorPredictionModelNotCached | |
ErrorPredictionModelNotFound | |
ErrorPredictionServiceUnavailable | |
ErrorPredictionStorage | |
ErrorPreparePerformanceMigrationFailed | |
ErrorProjectExportRequestFailed | |
ErrorProjectImportRequestFailed | |
ErrorProjectInvalidDomain | |
ErrorProjectInvalidPipelineConfiguration | |
ErrorProjectInvalidWorkspace | |
ErrorProjectTrainingRequestFailed | |
ErrorRegionProposal | |
ErrorUnknown | |
ErrorUnknownBaseModel | |
Forbidden | |
ForbiddenDRModeEnabled | |
ForbiddenInvalid | |
ForbiddenUser | |
ForbiddenUserDisabled | |
ForbiddenUserDoesNotExist | |
ForbiddenUserInsufficientCapability | |
ForbiddenUserResource | |
ForbiddenUserSignupAllowanceExceeded | |
ForbiddenUserSignupDisabled | |
NoError | |
NotFound | |
NotFoundApimSubscription | |
NotFoundDomain | |
NotFoundImage | |
NotFoundInvalid | |
NotFoundIteration | |
NotFoundIterationPerformance | |
NotFoundProject | |
NotFoundProjectDefaultIteration | |
NotFoundTag | |
UnsupportedMediaType |
Image
Image model to be sent as JSON.
Name | Type | Description |
---|---|---|
created |
string |
Date the image was created. |
height |
integer |
Height of the image. |
id |
string |
Id of the image. |
metadata |
object |
Metadata associated with this image. |
originalImageUri |
string |
The URI to the original uploaded image. If VNET feature is enabled this will be a relative path to be used with GetArtifact, otherwise this will be an absolute URI to the resource. |
regions |
Regions associated with this image. |
|
resizedImageUri |
string |
The URI to the (resized) image used for training. If VNET feature is enabled this will be a relative path to be used with GetArtifact, otherwise this will be an absolute URI to the resource. |
tags |
Image |
Tags associated with this image. |
thumbnailUri |
string |
The URI to the thumbnail of the original image. If VNET feature is enabled this will be a relative path to be used with GetArtifact, otherwise this will be an absolute URI to the resource. |
width |
integer |
Width of the image. |
ImageCreateResult
Name | Type | Description |
---|---|---|
image |
The image. |
|
sourceUrl |
string |
Source URL of the image. |
status |
Status of the image creation. |
ImageCreateStatus
Status of the image creation.
Value | Description |
---|---|
ErrorImageFormat | |
ErrorImageSize | |
ErrorLimitExceed | |
ErrorNegativeAndRegularTagOnSameImage | |
ErrorRegionLimitExceed | |
ErrorSource | |
ErrorStorage | |
ErrorTagLimitExceed | |
ErrorUnknown | |
OK | |
OKDuplicate |
ImageCreateSummary
Name | Type | Description |
---|---|---|
images |
List of the image creation results. |
|
isBatchSuccessful |
boolean |
True if all of the images in the batch were created successfully, otherwise false. |
ImageRegion
Name | Type | Description |
---|---|---|
created |
string |
|
height |
number |
Height. |
left |
number |
Coordinate of the left boundary. |
regionId |
string |
|
tagId |
string |
Id of the tag associated with this region. |
tagName |
string |
|
top |
number |
Coordinate of the top boundary. |
width |
number |
Width. |
ImageTag
Name | Type | Description |
---|---|---|
created |
string |
|
tagId |
string |
|
tagName |
string |
ImageUrlCreateBatch
Name | Type | Description |
---|---|---|
images | ||
metadata |
object |
The metadata of image. Limited to 50 key-value pairs per image. The length of key is limited to 256. The length of value is limited to 512. |
tagIds |
string[] |
ImageUrlCreateEntry
Name | Type | Description |
---|---|---|
regions |
Region[] |
|
tagIds |
string[] |
|
url |
string |
Url of the image. |
Region
Name | Type | Description |
---|---|---|
height |
number |
Height. |
left |
number |
Coordinate of the left boundary. |
tagId |
string |
Id of the tag associated with this region. |
top |
number |
Coordinate of the top boundary. |
width |
number |
Width. |