Condividi tramite


Images - List

This API supports batching and range selection. By default it will only return first 50 images matching images. Use the {take} and {skip} parameters to control how many images to return in a given batch. The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and "Cat" tags, then only images tagged with Dog and/or Cat will be returned

GET {Endpoint}/customvision/v3.3/training/projects/{projectId}/images
GET {Endpoint}/customvision/v3.3/training/projects/{projectId}/images?iterationId={iterationId}&tagIds={tagIds}&taggingStatus={taggingStatus}&$filter={$filter}&orderBy={orderBy}&take={take}&skip={skip}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Cognitive Services endpoints.

projectId
path True

string

uuid

The project id.

$filter
query

string

An expression to filter the images against image metadata. Only images where the expression evaluates to true are included in the response. The expression supports eq (Equal), ne (Not equal), and (Logical and), or (Logical or) operators. Here is an example, metadata=key1 eq 'value1' and key2 ne 'value2'.

iterationId
query

string

uuid

The iteration id. Defaults to workspace.

orderBy
query

string

The ordering. Defaults to newest.

skip
query

integer

int32

Number of images to skip before beginning the image batch. Defaults to 0.

taggingStatus
query

string

The tagging status filter. It can be 'All', 'Tagged', or 'Untagged'. Defaults to 'All'.

tagIds
query

string[]

A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20.

take
query

integer

int32

Maximum number of images to return. Defaults to 50, limited to 256.

Request Header

Name Required Type Description
Training-Key True

string

Responses

Name Type Description
200 OK

Image[]

OK

Media Types: "application/json", "application/xml", "text/xml"

Other Status Codes

CustomVisionError

Error response

Media Types: "application/json", "application/xml", "text/xml"

Security

Training-Key

Type: apiKey
In: header

Examples

Successful GetImages request

Sample request

GET https://westus.api.cognitive.microsoft.com/customvision/v3.3/training/projects/bc3f7dad-5544-468c-8573-3ef04d55463e/images

Sample response

[
  {
    "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 1"
      }
    ]
  },
  {
    "id": "f1855a92-b873-47e7-b513-f07a667ceda1",
    "created": "2017-12-19T15:56:10Z",
    "width": 900,
    "height": 1531,
    "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 1"
      }
    ]
  }
]

Definitions

Name Description
CustomVisionError
CustomVisionErrorCodes

The error code.

Image

Image model to be sent as JSON.

ImageRegion
ImageTag

CustomVisionError

Name Type Description
code

CustomVisionErrorCodes

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

ImageRegion[]

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

ImageTag[]

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.

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