Images - List Suggested

This API will fetch untagged images filtered by suggested tags Ids. It returns an empty array if no images are found.

POST {Endpoint}/customvision/v3.3/training/projects/{projectId}/images/suggested?iterationId={iterationId}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Cognitive Services endpoints.

projectId
path True

string

uuid

The project id.

iterationId
query True

string

uuid

IterationId to use for the suggested tags and regions.

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
continuation

string

Continuation Id for database pagination. Initially null but later used to paginate.

maxCount

integer

Maximum number of results you want to be returned in the response.

session

string

SessionId for database query. Initially set to null but later used to paginate.

sortBy

SortBy

OrderBy. Ordering mechanism for your results.

tagIds

string[]

Existing TagIds in project to filter suggested tags on.

threshold

number

Confidence threshold to filter suggested tags on.

Responses

Name Type Description
200 OK

SuggestedTagAndRegionQuery

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 QuerySuggestedImages request

Sample request

POST https://westus.api.cognitive.microsoft.com/customvision/v3.3/training/projects/bc3f7dad-5544-468c-8573-3ef04d55463e/images/suggested?iterationId=b7b9d99c-a2c6-4658-9900-a98d2ff5bc66


{
  "tagIds": [
    "b5f7e6a2-a481-49a6-afec-a7cef1af3544"
  ]
}

Sample response

{
  "results": [
    {
      "id": "dfd2d346-3ed5-4e1e-857d-af4e32cec042",
      "project": "8988643a-ae70-447d-9a22-15c4255e5ecb",
      "iteration": "b7b9d99c-a2c6-4658-9900-a98d2ff5bc66",
      "created": "2018-01-31T20:18:26Z",
      "predictions": [
        {
          "tagId": "b5f7e6a2-a481-49a6-afec-a7cef1af3544",
          "tagName": "Tag 1",
          "probability": 1
        },
        {
          "tagId": "45619cda-d1c9-4bc8-a3e1-87c5d81adbc3",
          "tagName": "Tag 2",
          "probability": 3.60627153E-12
        }
      ],
      "originalImageUri": "<image uri>",
      "thumbnailUri": "<thumbnail uri>",
      "resizedImageUri": "<resized image uri>",
      "domain": "b30a91ae-e3c1-4f73-a81e-c270bff27c39"
    }
  ],
  "token": {
    "session": "1:286613",
    "continuation": "",
    "maxCount": 0,
    "sortBy": "Newest",
    "tagIds": [
      "b5f7e6a2-a481-49a6-afec-a7cef1af3544"
    ]
  }
}

Definitions

Name Description
BoundingBox

Bounding box that defines a region of an image.

CustomVisionError
CustomVisionErrorCodes

The error code.

Prediction

Prediction result.

SortBy

OrderBy. Ordering mechanism for your results.

StoredSuggestedTagAndRegion

Result of a suggested tags and regions request of the untagged image.

SuggestedTagAndRegionQuery

The array of result images and token containing session and continuation Ids for the next query.

SuggestedTagAndRegionQueryToken

Contains properties we need to fetch suggested tags for. For the first call, Session and continuation set to null. Then on subsequent calls, uses the session/continuation from the previous SuggestedTagAndRegionQuery result to fetch additional results.

TagType

Type of the predicted tag.

BoundingBox

Bounding box that defines a region of an image.

Name Type Description
height

number

Height.

left

number

Coordinate of the left boundary.

top

number

Coordinate of the top boundary.

width

number

Width.

CustomVisionError

Name Type Description
code

CustomVisionErrorCodes

The error code.

message

string

A message explaining the error reported by the service.

CustomVisionErrorCodes

The error code.

Name Type Description
BadRequest

string

BadRequestCannotMigrateProjectWithName

string

BadRequestClassificationTrainingValidationFailed

string

BadRequestCustomerManagedKeyRevoked

string

BadRequestDetectionTrainingNotAllowNegativeTag

string

BadRequestDetectionTrainingValidationFailed

string

BadRequestDomainNotSupportedForAdvancedTraining

string

BadRequestExceedIterationPerProjectLimit

string

BadRequestExceedProjectLimit

string

BadRequestExceedTagPerImageLimit

string

BadRequestExceedTagPerProjectLimit

string

BadRequestExceededBatchSize

string

BadRequestExceededQuota

string

BadRequestExportAlreadyInProgress

string

BadRequestExportPlatformNotSupportedForAdvancedTraining

string

BadRequestExportValidationFailed

string

BadRequestExportWhileTraining

string

BadRequestImageBatch

string

BadRequestImageDimensions

string

BadRequestImageExceededCount

string

BadRequestImageFormat

string

BadRequestImageMetadataKey

string

BadRequestImageMetadataValue

string

BadRequestImageRegions

string

BadRequestImageSizeBytes

string

BadRequestImageStream

string

BadRequestImageTags

string

BadRequestImageUrl

string

BadRequestInvalid

string

BadRequestInvalidArtifactUri

string

BadRequestInvalidEmailAddress

string

BadRequestInvalidIds

string

BadRequestInvalidImportToken

string

BadRequestInvalidPublishName

string

BadRequestInvalidPublishTarget

string

BadRequestIterationDescription

string

BadRequestIterationIsNotTrained

string

BadRequestIterationIsPublished

string

BadRequestIterationName

string

BadRequestIterationNameNotUnique

string

BadRequestIterationNotPublished

string

BadRequestIterationValidationFailed

string

BadRequestMultiClassClassificationTrainingValidationFailed

string

BadRequestMultiLabelClassificationTrainingValidationFailed

string

BadRequestMultipleGeneralProductTag

string

BadRequestMultipleNegativeTag

string

BadRequestNegativeAndRegularTagOnSameImage

string

BadRequestNotLimitedTrial

string

BadRequestNotSupported

string

BadRequestOperationNotSupported

string

BadRequestPredictionIdsExceededCount

string

BadRequestPredictionIdsMissing

string

BadRequestPredictionInvalidApplicationName

string

BadRequestPredictionInvalidQueryParameters

string

BadRequestPredictionResultsExceededCount

string

BadRequestPredictionTagsExceededCount

string

BadRequestProjectDescription

string

BadRequestProjectDuplicated

string

BadRequestProjectImagePreprocessingSettings

string

BadRequestProjectName

string

BadRequestProjectNameNotUnique

string

BadRequestProjectUnknownClassification

string

BadRequestProjectUnknownDomain

string

BadRequestProjectUnsupportedDomainTypeChange

string

BadRequestProjectUnsupportedExportPlatform

string

BadRequestRequiredParamIsNull

string

BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining

string

BadRequestSubscriptionApi

string

BadRequestTagDescription

string

BadRequestTagName

string

BadRequestTagNameNotUnique

string

BadRequestTagType

string

BadRequestTrainingAlreadyInProgress

string

BadRequestTrainingNotNeeded

string

BadRequestTrainingNotNeededButTrainingPipelineUpdated

string

BadRequestTrainingValidationFailed

string

BadRequestUnpublishFailed

string

BadRequestUnsupportedDomain

string

BadRequestWorkspaceCannotBeModified

string

BadRequestWorkspaceNotDeletable

string

Conflict

string

ConflictInvalid

string

ErrorExporterInvalidClassifier

string

ErrorExporterInvalidFeaturizer

string

ErrorExporterInvalidPlatform

string

ErrorFeaturizationAugmentationError

string

ErrorFeaturizationAugmentationUnavailable

string

ErrorFeaturizationInvalidFeaturizer

string

ErrorFeaturizationQueueTimeout

string

ErrorFeaturizationServiceUnavailable

string

ErrorFeaturizationUnrecognizedJob

string

ErrorInvalid

string

ErrorIterationCopyFailed

string

ErrorPrediction

string

ErrorPredictionModelNotCached

string

ErrorPredictionModelNotFound

string

ErrorPredictionServiceUnavailable

string

ErrorPredictionStorage

string

ErrorPreparePerformanceMigrationFailed

string

ErrorProjectExportRequestFailed

string

ErrorProjectImportRequestFailed

string

ErrorProjectInvalidDomain

string

ErrorProjectInvalidPipelineConfiguration

string

ErrorProjectInvalidWorkspace

string

ErrorProjectTrainingRequestFailed

string

ErrorRegionProposal

string

ErrorUnknown

string

ErrorUnknownBaseModel

string

Forbidden

string

ForbiddenDRModeEnabled

string

ForbiddenInvalid

string

ForbiddenUser

string

ForbiddenUserDisabled

string

ForbiddenUserDoesNotExist

string

ForbiddenUserInsufficientCapability

string

ForbiddenUserResource

string

ForbiddenUserSignupAllowanceExceeded

string

ForbiddenUserSignupDisabled

string

NoError

string

NotFound

string

NotFoundApimSubscription

string

NotFoundDomain

string

NotFoundImage

string

NotFoundInvalid

string

NotFoundIteration

string

NotFoundIterationPerformance

string

NotFoundProject

string

NotFoundProjectDefaultIteration

string

NotFoundTag

string

UnsupportedMediaType

string

Prediction

Prediction result.

Name Type Description
boundingBox

BoundingBox

Bounding box of the prediction.

probability

number

Probability of the tag.

tagId

string

Id of the predicted tag.

tagName

string

Name of the predicted tag.

tagType

TagType

Type of the predicted tag.

SortBy

OrderBy. Ordering mechanism for your results.

Name Type Description
UncertaintyAscending

string

UncertaintyDescending

string

StoredSuggestedTagAndRegion

Result of a suggested tags and regions request of the untagged image.

Name Type Description
created

string

Date this prediction was created.

domain

string

Domain used for the prediction.

height

integer

Height of the resized image.

id

string

Prediction Id.

iteration

string

Iteration Id.

originalImageUri

string

The URI to the original prediction 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.

predictionUncertainty

number

Uncertainty (entropy) of suggested tags or regions per image.

predictions

Prediction[]

List of predictions.

project

string

Project Id.

resizedImageUri

string

The URI to the (resized) prediction 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.

thumbnailUri

string

The URI to the thumbnail of the original prediction 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 resized image.

SuggestedTagAndRegionQuery

The array of result images and token containing session and continuation Ids for the next query.

Name Type Description
results

StoredSuggestedTagAndRegion[]

Result of a suggested tags and regions request of the untagged image.

token

SuggestedTagAndRegionQueryToken

Contains properties we need to fetch suggested tags for.

SuggestedTagAndRegionQueryToken

Contains properties we need to fetch suggested tags for. For the first call, Session and continuation set to null. Then on subsequent calls, uses the session/continuation from the previous SuggestedTagAndRegionQuery result to fetch additional results.

Name Type Description
continuation

string

Continuation Id for database pagination. Initially null but later used to paginate.

maxCount

integer

Maximum number of results you want to be returned in the response.

session

string

SessionId for database query. Initially set to null but later used to paginate.

sortBy

SortBy

OrderBy. Ordering mechanism for your results.

tagIds

string[]

Existing TagIds in project to filter suggested tags on.

threshold

number

Confidence threshold to filter suggested tags on.

TagType

Type of the predicted tag.

Name Type Description
GeneralProduct

string

Negative

string

Regular

string