Share via


Images - Get Count

Get the number of images. 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/count
GET {Endpoint}/customvision/v3.3/training/projects/{projectId}/images/count?iterationId={iterationId}&taggingStatus={taggingStatus}&$filter={$filter}&tagIds={tagIds}

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.

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 to count. Defaults to all tags when null.

Request Header

Name Required Type Description
Training-Key True

string

Responses

Name Type Description
200 OK

integer

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

Sample request

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

Sample response

12

Definitions

Name Description
CustomVisionError
CustomVisionErrorCodes

The error code.

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