From 2bf921a9097a6aedc40f7494f440de83fdf7812c Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Tue, 10 Nov 2020 03:00:25 +0000 Subject: [PATCH] Release 5.2.0 version of customvision training --- .../package.json | 2 +- .../rollup.config.js | 4 +- .../src/models/index.ts | 191 ++++++++++++++---- .../src/models/mappers.ts | 136 ++++++++++++- .../src/models/parameters.ts | 5 +- .../src/trainingAPIClient.ts | 30 +-- .../src/trainingAPIClientContext.ts | 9 +- 7 files changed, 315 insertions(+), 62 deletions(-) diff --git a/sdk/cognitiveservices/cognitiveservices-customvision-training/package.json b/sdk/cognitiveservices/cognitiveservices-customvision-training/package.json index e981fe1e64c0..66c6ad641c5c 100644 --- a/sdk/cognitiveservices/cognitiveservices-customvision-training/package.json +++ b/sdk/cognitiveservices/cognitiveservices-customvision-training/package.json @@ -2,7 +2,7 @@ "name": "@azure/cognitiveservices-customvision-training", "author": "Microsoft Corporation", "description": "TrainingAPIClient Library with typescript type definitions for node.js and browser.", - "version": "5.1.2", + "version": "5.2.0", "dependencies": { "@azure/ms-rest-js": "^2.0.4", "tslib": "^1.10.0" diff --git a/sdk/cognitiveservices/cognitiveservices-customvision-training/rollup.config.js b/sdk/cognitiveservices/cognitiveservices-customvision-training/rollup.config.js index 479c41e4b7ef..fc6f565c06aa 100644 --- a/sdk/cognitiveservices/cognitiveservices-customvision-training/rollup.config.js +++ b/sdk/cognitiveservices/cognitiveservices-customvision-training/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/index.ts b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/index.ts index 4fc048edaad4..e633b72c0d0e 100644 --- a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/index.ts +++ b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -31,6 +31,36 @@ export interface BoundingBox { height: number; } +/** + * Options used for createProject. + */ +export interface CreateProjectOptions { + /** + * The uri to the Azure Storage container that will be used to store exported models. + */ + exportModelContainerUri?: string; + /** + * The uri to the Azure Storage queue that will be used to send project-related notifications. + * See Storage notifications + * documentation for setup and message format. + */ + notificationQueueUri?: string; +} + +/** + * An interface representing CustomBaseModelInfo. + */ +export interface CustomBaseModelInfo { + /** + * Project Id of the previously trained project to be used for current iteration's training. + */ + projectId: string; + /** + * Iteration Id of the previously trained project to be used for current iteration's training. + */ + iterationId: string; +} + /** * An interface representing CustomVisionError. */ @@ -57,23 +87,27 @@ export interface CustomVisionError { * 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', * 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', 'BadRequestImageStream', * 'BadRequestImageUrl', 'BadRequestImageFormat', 'BadRequestImageSizeBytes', - * 'BadRequestImageDimensions', 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', - * 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', 'BadRequestTrainingValidationFailed', - * 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestImageDimensions', 'BadRequestImageAspectRatio', 'BadRequestImageExceededCount', + * 'BadRequestTrainingNotNeeded', 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', + * 'BadRequestTrainingValidationFailed', 'BadRequestClassificationTrainingValidationFailed', * 'BadRequestMultiClassClassificationTrainingValidationFailed', * 'BadRequestMultiLabelClassificationTrainingValidationFailed', * 'BadRequestDetectionTrainingValidationFailed', 'BadRequestTrainingAlreadyInProgress', * 'BadRequestDetectionTrainingNotAllowNegativeTag', 'BadRequestInvalidEmailAddress', + * 'BadRequestRetiredDomainNotSupportedForTraining', * 'BadRequestDomainNotSupportedForAdvancedTraining', * 'BadRequestExportPlatformNotSupportedForAdvancedTraining', * 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', - * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', - * 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', - * 'BadRequestPredictionTagsExceededCount', 'BadRequestPredictionResultsExceededCount', - * 'BadRequestPredictionInvalidApplicationName', 'BadRequestPredictionInvalidQueryParameters', - * 'BadRequestInvalidImportToken', 'BadRequestExportWhileTraining', 'BadRequestImageMetadataKey', - * 'BadRequestImageMetadataValue', 'BadRequestOperationNotSupported', - * 'BadRequestInvalidArtifactUri', 'BadRequestCustomerManagedKeyRevoked', 'BadRequestInvalid', + * 'BadRequestCustomBaseModelIterationStatusNotCompleted', + * 'BadRequestCustomBaseModelDomainNotCompatible', + * 'BadRequestCustomBaseModelArchitectureRetired', 'BadRequestExportValidationFailed', + * 'BadRequestExportAlreadyInProgress', 'BadRequestPredictionIdsMissing', + * 'BadRequestPredictionIdsExceededCount', 'BadRequestPredictionTagsExceededCount', + * 'BadRequestPredictionResultsExceededCount', 'BadRequestPredictionInvalidApplicationName', + * 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalidImportToken', + * 'BadRequestExportWhileTraining', 'BadRequestImageMetadataKey', 'BadRequestImageMetadataValue', + * 'BadRequestOperationNotSupported', 'BadRequestInvalidArtifactUri', + * 'BadRequestCustomerManagedKeyRevoked', 'BadRequestInvalidUri', 'BadRequestInvalid', * 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', 'ForbiddenUserResource', * 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', * 'ForbiddenUserDoesNotExist', 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', @@ -91,7 +125,7 @@ export interface CustomVisionError { * 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', * 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', * 'ErrorPredictionModelNotCached', 'ErrorPrediction', 'ErrorPredictionStorage', - * 'ErrorRegionProposal', 'ErrorUnknownBaseModel', 'ErrorInvalid' + * 'ErrorRegionProposal', 'ErrorUnknownBaseModel', 'ErrorServerTimeOut', 'ErrorInvalid' */ code: CustomVisionErrorCodes; /** @@ -101,30 +135,62 @@ export interface CustomVisionError { } /** - * An interface representing Domain. + * Model information. + */ +export interface ModelInformation { + /** + * Estimation of the exported FP32 Onnx model size (2 tags) in megabytes. This information is not + * present if the model cannot be exported. + */ + estimatedModelSizeInMegabytes?: number; + /** + * Model description. + */ + description: string; +} + +/** + * Domains are used as the starting point for your project. Each domain is optimized for specific + * types of images. Domains with compact in their name can be exported. For more information visit + * the domain documentation. */ export interface Domain { /** + * Domain id. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** + * Name of the domain, describing the types of images used to train it. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * Possible values include: 'Classification', 'ObjectDetection' + * Domain type: Classification or ObjectDetection. Possible values include: 'Classification', + * 'ObjectDetection' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: DomainType; /** + * Indicating if the domain is exportable. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly exportable?: boolean; /** + * Indicating if the domain is enabled. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly enabled?: boolean; + /** + * Platforms that the domain can be exported to. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly exportablePlatforms?: string[]; + /** + * Model information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly modelInformation?: ModelInformation; } /** @@ -133,7 +199,7 @@ export interface Domain { export interface ExportModel { /** * Platform of the export. Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', - * 'VAIDK' + * 'VAIDK', 'OpenVino' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly platform?: ExportPlatform; @@ -295,7 +361,7 @@ export interface ImageCreateResult { * Status of the image creation. Possible values include: 'OK', 'OKDuplicate', 'ErrorSource', * 'ErrorImageFormat', 'ErrorImageSize', 'ErrorStorage', 'ErrorLimitExceed', * 'ErrorTagLimitExceed', 'ErrorRegionLimitExceed', 'ErrorUnknown', - * 'ErrorNegativeAndRegularTagOnSameImage' + * 'ErrorNegativeAndRegularTagOnSameImage', 'ErrorImageDimensions', 'ErrorInvalidTag' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly status?: ImageCreateStatus; @@ -365,8 +431,8 @@ export interface ImageFileCreateBatch { images?: ImageFileCreateEntry[]; tagIds?: string[]; /** - * 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. + * The metadata of image. Limited to 10 key-value pairs per image. The length of key is limited + * to 128. The length of value is limited to 256. */ metadata?: { [propertyName: string]: string }; } @@ -390,8 +456,8 @@ export interface ImageIdCreateBatch { images?: ImageIdCreateEntry[]; tagIds?: string[]; /** - * 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. + * The metadata of image. Limited to 10 key-value pairs per image. The length of key is limited + * to 128. The length of value is limited to 256. */ metadata?: { [propertyName: string]: string }; } @@ -469,34 +535,45 @@ export interface ImagePerformance { */ readonly predictions?: Prediction[]; /** + * Id of the image. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** + * Date the image was created. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly created?: Date; /** + * Width of the image. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly width?: number; /** + * Height of the image. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly height?: number; /** + * The URI to the 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. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly imageUri?: 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. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly thumbnailUri?: string; /** + * Tags associated with this image. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly tags?: ImageTag[]; /** + * Regions associated with this image. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly regions?: ImageRegion[]; @@ -728,8 +805,8 @@ export interface ImageUrlCreateBatch { images?: ImageUrlCreateEntry[]; tagIds?: string[]; /** - * 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. + * The metadata of image. Limited to 10 key-value pairs per image. The length of key is limited + * to 128. The length of value is limited to 256. */ metadata?: { [propertyName: string]: string }; } @@ -818,6 +895,20 @@ export interface Iteration { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly originalPublishResourceId?: string; + /** + * Information of the previously trained iteration which provides the base model for current + * iteration's training. + * Default value of null specifies that no previously trained iteration will be used for + * incremental learning. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly customBaseModelInfo?: CustomBaseModelInfo; + /** + * Training error details, when training fails. + * Value is null when training succeeds. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly trainingErrorDetails?: string; } /** @@ -1023,6 +1114,18 @@ export interface ProjectSettings { * Gets or sets image preprocessing settings. */ imageProcessingSettings?: ImageProcessingSettings; + /** + * The uri to the Azure Storage container that will be used to store exported models. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly exportModelContainerUri?: string; + /** + * The uri to the Azure Storage queue that will be used to send project-related notifications. + * See Storage notifications + * documentation for setup and message format. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly notificationQueueUri?: string; } /** @@ -1322,6 +1425,11 @@ export interface TrainingParameters { * List of tags selected for this training session, other tags in the project will be ignored. */ selectedTags?: string[]; + /** + * Information of the previously trained iteration which provides the base model for current + * iteration's training. + */ + customBaseModelInfo?: CustomBaseModelInfo; } /** @@ -1345,6 +1453,10 @@ export interface TrainingAPIClientCreateProjectOptionalParams extends msRest.Req * List of platforms the trained model is intending exporting to. */ targetExportPlatforms?: string[]; + /** + * Additional project creation options. + */ + options?: CreateProjectOptions; } /** @@ -1725,25 +1837,29 @@ export interface TrainingAPIClientImportProjectOptionalParams extends msRest.Req * 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', * 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', * 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', - * 'BadRequestImageSizeBytes', 'BadRequestImageDimensions', 'BadRequestImageExceededCount', - * 'BadRequestTrainingNotNeeded', 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', - * 'BadRequestTrainingValidationFailed', 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestImageSizeBytes', 'BadRequestImageDimensions', 'BadRequestImageAspectRatio', + * 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', + * 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', 'BadRequestTrainingValidationFailed', + * 'BadRequestClassificationTrainingValidationFailed', * 'BadRequestMultiClassClassificationTrainingValidationFailed', * 'BadRequestMultiLabelClassificationTrainingValidationFailed', * 'BadRequestDetectionTrainingValidationFailed', 'BadRequestTrainingAlreadyInProgress', * 'BadRequestDetectionTrainingNotAllowNegativeTag', 'BadRequestInvalidEmailAddress', + * 'BadRequestRetiredDomainNotSupportedForTraining', * 'BadRequestDomainNotSupportedForAdvancedTraining', * 'BadRequestExportPlatformNotSupportedForAdvancedTraining', * 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + * 'BadRequestCustomBaseModelIterationStatusNotCompleted', + * 'BadRequestCustomBaseModelDomainNotCompatible', 'BadRequestCustomBaseModelArchitectureRetired', * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', * 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', * 'BadRequestPredictionTagsExceededCount', 'BadRequestPredictionResultsExceededCount', * 'BadRequestPredictionInvalidApplicationName', 'BadRequestPredictionInvalidQueryParameters', * 'BadRequestInvalidImportToken', 'BadRequestExportWhileTraining', 'BadRequestImageMetadataKey', * 'BadRequestImageMetadataValue', 'BadRequestOperationNotSupported', - * 'BadRequestInvalidArtifactUri', 'BadRequestCustomerManagedKeyRevoked', 'BadRequestInvalid', - * 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', 'ForbiddenUserResource', - * 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', + * 'BadRequestInvalidArtifactUri', 'BadRequestCustomerManagedKeyRevoked', 'BadRequestInvalidUri', + * 'BadRequestInvalid', 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', + * 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', * 'ForbiddenUserDoesNotExist', 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', * 'ForbiddenDRModeEnabled', 'ForbiddenInvalid', 'NotFound', 'NotFoundProject', * 'NotFoundProjectDefaultIteration', 'NotFoundIteration', 'NotFoundIterationPerformance', @@ -1759,11 +1875,11 @@ export interface TrainingAPIClientImportProjectOptionalParams extends msRest.Req * 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', * 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', * 'ErrorPredictionModelNotCached', 'ErrorPrediction', 'ErrorPredictionStorage', - * 'ErrorRegionProposal', 'ErrorUnknownBaseModel', 'ErrorInvalid' + * 'ErrorRegionProposal', 'ErrorUnknownBaseModel', 'ErrorServerTimeOut', 'ErrorInvalid' * @readonly * @enum {string} */ -export type 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'; +export type 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' | 'BadRequestImageAspectRatio' | 'BadRequestImageExceededCount' | 'BadRequestTrainingNotNeeded' | 'BadRequestTrainingNotNeededButTrainingPipelineUpdated' | 'BadRequestTrainingValidationFailed' | 'BadRequestClassificationTrainingValidationFailed' | 'BadRequestMultiClassClassificationTrainingValidationFailed' | 'BadRequestMultiLabelClassificationTrainingValidationFailed' | 'BadRequestDetectionTrainingValidationFailed' | 'BadRequestTrainingAlreadyInProgress' | 'BadRequestDetectionTrainingNotAllowNegativeTag' | 'BadRequestInvalidEmailAddress' | 'BadRequestRetiredDomainNotSupportedForTraining' | 'BadRequestDomainNotSupportedForAdvancedTraining' | 'BadRequestExportPlatformNotSupportedForAdvancedTraining' | 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining' | 'BadRequestCustomBaseModelIterationStatusNotCompleted' | 'BadRequestCustomBaseModelDomainNotCompatible' | 'BadRequestCustomBaseModelArchitectureRetired' | 'BadRequestExportValidationFailed' | 'BadRequestExportAlreadyInProgress' | 'BadRequestPredictionIdsMissing' | 'BadRequestPredictionIdsExceededCount' | 'BadRequestPredictionTagsExceededCount' | 'BadRequestPredictionResultsExceededCount' | 'BadRequestPredictionInvalidApplicationName' | 'BadRequestPredictionInvalidQueryParameters' | 'BadRequestInvalidImportToken' | 'BadRequestExportWhileTraining' | 'BadRequestImageMetadataKey' | 'BadRequestImageMetadataValue' | 'BadRequestOperationNotSupported' | 'BadRequestInvalidArtifactUri' | 'BadRequestCustomerManagedKeyRevoked' | 'BadRequestInvalidUri' | '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' | 'ErrorServerTimeOut' | 'ErrorInvalid'; /** * Defines values for DomainType. @@ -1775,11 +1891,11 @@ export type DomainType = 'Classification' | 'ObjectDetection'; /** * Defines values for ExportPlatform. - * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' + * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK', 'OpenVino' * @readonly * @enum {string} */ -export type ExportPlatform = 'CoreML' | 'TensorFlow' | 'DockerFile' | 'ONNX' | 'VAIDK'; +export type ExportPlatform = 'CoreML' | 'TensorFlow' | 'DockerFile' | 'ONNX' | 'VAIDK' | 'OpenVino'; /** * Defines values for ExportStatus. @@ -1802,11 +1918,12 @@ export type ExportFlavor = 'Linux' | 'Windows' | 'ONNX10' | 'ONNX12' | 'ARM' | ' * Defines values for ImageCreateStatus. * Possible values include: 'OK', 'OKDuplicate', 'ErrorSource', 'ErrorImageFormat', * 'ErrorImageSize', 'ErrorStorage', 'ErrorLimitExceed', 'ErrorTagLimitExceed', - * 'ErrorRegionLimitExceed', 'ErrorUnknown', 'ErrorNegativeAndRegularTagOnSameImage' + * 'ErrorRegionLimitExceed', 'ErrorUnknown', 'ErrorNegativeAndRegularTagOnSameImage', + * 'ErrorImageDimensions', 'ErrorInvalidTag' * @readonly * @enum {string} */ -export type ImageCreateStatus = 'OK' | 'OKDuplicate' | 'ErrorSource' | 'ErrorImageFormat' | 'ErrorImageSize' | 'ErrorStorage' | 'ErrorLimitExceed' | 'ErrorTagLimitExceed' | 'ErrorRegionLimitExceed' | 'ErrorUnknown' | 'ErrorNegativeAndRegularTagOnSameImage'; +export type ImageCreateStatus = 'OK' | 'OKDuplicate' | 'ErrorSource' | 'ErrorImageFormat' | 'ErrorImageSize' | 'ErrorStorage' | 'ErrorLimitExceed' | 'ErrorTagLimitExceed' | 'ErrorRegionLimitExceed' | 'ErrorUnknown' | 'ErrorNegativeAndRegularTagOnSameImage' | 'ErrorImageDimensions' | 'ErrorInvalidTag'; /** * Defines values for ImageMetadataUpdateStatus. @@ -1947,11 +2064,11 @@ export type TrainingType1 = 'Regular' | 'Advanced'; /** * Defines values for Platform. - * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' + * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK', 'OpenVino' * @readonly * @enum {string} */ -export type Platform = 'CoreML' | 'TensorFlow' | 'DockerFile' | 'ONNX' | 'VAIDK'; +export type Platform = 'CoreML' | 'TensorFlow' | 'DockerFile' | 'ONNX' | 'VAIDK' | 'OpenVino'; /** * Contains response data for the getDomains operation. diff --git a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/mappers.ts b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/mappers.ts index de3a69f46cf7..37d24b69f010 100644 --- a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/mappers.ts +++ b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -51,6 +51,56 @@ export const BoundingBox: msRest.CompositeMapper = { } }; +export const CreateProjectOptions: msRest.CompositeMapper = { + serializedName: "CreateProjectOptions", + type: { + name: "Composite", + className: "CreateProjectOptions", + modelProperties: { + exportModelContainerUri: { + nullable: false, + serializedName: "exportModelContainerUri", + type: { + name: "String" + } + }, + notificationQueueUri: { + nullable: false, + serializedName: "notificationQueueUri", + type: { + name: "String" + } + } + } + } +}; + +export const CustomBaseModelInfo: msRest.CompositeMapper = { + serializedName: "CustomBaseModelInfo", + type: { + name: "Composite", + className: "CustomBaseModelInfo", + modelProperties: { + projectId: { + required: true, + nullable: false, + serializedName: "projectId", + type: { + name: "Uuid" + } + }, + iterationId: { + required: true, + nullable: false, + serializedName: "iterationId", + type: { + name: "Uuid" + } + } + } + } +}; + export const CustomVisionError: msRest.CompositeMapper = { serializedName: "CustomVisionError", type: { @@ -75,6 +125,30 @@ export const CustomVisionError: msRest.CompositeMapper = { } }; +export const ModelInformation: msRest.CompositeMapper = { + serializedName: "ModelInformation", + type: { + name: "Composite", + className: "ModelInformation", + modelProperties: { + estimatedModelSizeInMegabytes: { + serializedName: "estimatedModelSizeInMegabytes", + type: { + name: "Number" + } + }, + description: { + required: true, + nullable: false, + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + export const Domain: msRest.CompositeMapper = { serializedName: "Domain", type: { @@ -120,6 +194,26 @@ export const Domain: msRest.CompositeMapper = { type: { name: "Boolean" } + }, + exportablePlatforms: { + readOnly: true, + serializedName: "exportablePlatforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + modelInformation: { + readOnly: true, + serializedName: "modelInformation", + type: { + name: "Composite", + className: "ModelInformation" + } } } } @@ -1582,6 +1676,21 @@ export const Iteration: msRest.CompositeMapper = { type: { name: "String" } + }, + customBaseModelInfo: { + readOnly: true, + serializedName: "customBaseModelInfo", + type: { + name: "Composite", + className: "CustomBaseModelInfo" + } + }, + trainingErrorDetails: { + readOnly: true, + serializedName: "trainingErrorDetails", + type: { + name: "String" + } } } } @@ -1992,6 +2101,22 @@ export const ProjectSettings: msRest.CompositeMapper = { name: "Composite", className: "ImageProcessingSettings" } + }, + exportModelContainerUri: { + nullable: true, + readOnly: true, + serializedName: "exportModelContainerUri", + type: { + name: "String" + } + }, + notificationQueueUri: { + nullable: true, + readOnly: true, + serializedName: "notificationQueueUri", + type: { + name: "String" + } } } } @@ -2486,6 +2611,13 @@ export const TrainingParameters: msRest.CompositeMapper = { } } } + }, + customBaseModelInfo: { + serializedName: "customBaseModelInfo", + type: { + name: "Composite", + className: "CustomBaseModelInfo" + } } } } diff --git a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/parameters.ts b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/parameters.ts index 61a9d3cffbe0..d9dbbcf9a120 100644 --- a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/parameters.ts +++ b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is diff --git a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/trainingAPIClient.ts b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/trainingAPIClient.ts index 8566f3c856b6..ea4d9583d4d1 100644 --- a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/trainingAPIClient.ts +++ b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/trainingAPIClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -519,8 +518,8 @@ class TrainingAPIClient extends TrainingAPIClientContext { * @summary Update metadata of images. * @param projectId The project id. * @param imageIds The list of image ids to update. Limited to 64. - * @param metadata The metadata to be updated to the specified images. Limited to 50 key-value - * pairs per image. The length of key is limited to 256. The length of value is limited to 512. + * @param metadata The metadata to be updated to the specified images. Limited to 10 key-value + * pairs per image. The length of key is limited to 128. The length of value is limited to 256. * @param [options] The optional parameters * @returns Promise */ @@ -528,16 +527,16 @@ class TrainingAPIClient extends TrainingAPIClientContext { /** * @param projectId The project id. * @param imageIds The list of image ids to update. Limited to 64. - * @param metadata The metadata to be updated to the specified images. Limited to 50 key-value - * pairs per image. The length of key is limited to 256. The length of value is limited to 512. + * @param metadata The metadata to be updated to the specified images. Limited to 10 key-value + * pairs per image. The length of key is limited to 128. The length of value is limited to 256. * @param callback The callback */ updateImageMetadata(projectId: string, imageIds: string[], metadata: { [propertyName: string]: string }, callback: msRest.ServiceCallback): void; /** * @param projectId The project id. * @param imageIds The list of image ids to update. Limited to 64. - * @param metadata The metadata to be updated to the specified images. Limited to 50 key-value - * pairs per image. The length of key is limited to 256. The length of value is limited to 512. + * @param metadata The metadata to be updated to the specified images. Limited to 10 key-value + * pairs per image. The length of key is limited to 128. The length of value is limited to 256. * @param options The optional parameters * @param callback The callback */ @@ -1136,7 +1135,7 @@ class TrainingAPIClient extends TrainingAPIClientContext { * @param projectId The project id. * @param iterationId The iteration id. * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', - * 'DockerFile', 'ONNX', 'VAIDK' + * 'DockerFile', 'ONNX', 'VAIDK', 'OpenVino' * @param [options] The optional parameters * @returns Promise */ @@ -1145,7 +1144,7 @@ class TrainingAPIClient extends TrainingAPIClientContext { * @param projectId The project id. * @param iterationId The iteration id. * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', - * 'DockerFile', 'ONNX', 'VAIDK' + * 'DockerFile', 'ONNX', 'VAIDK', 'OpenVino' * @param callback The callback */ exportIteration(projectId: string, iterationId: string, platform: Models.Platform, callback: msRest.ServiceCallback): void; @@ -1153,7 +1152,7 @@ class TrainingAPIClient extends TrainingAPIClientContext { * @param projectId The project id. * @param iterationId The iteration id. * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', - * 'DockerFile', 'ONNX', 'VAIDK' + * 'DockerFile', 'ONNX', 'VAIDK', 'OpenVino' * @param options The optional parameters * @param callback The callback */ @@ -1829,6 +1828,13 @@ const createProjectOperationSpec: msRest.OperationSpec = { Parameters.classificationType, Parameters.targetExportPlatforms ], + requestBody: { + parameterPath: [ + "options", + "options" + ], + mapper: Mappers.CreateProjectOptions + }, responses: { 200: { bodyMapper: Mappers.Project diff --git a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/trainingAPIClientContext.ts b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/trainingAPIClientContext.ts index f9a97a277880..5d60a8609bc1 100644 --- a/sdk/cognitiveservices/cognitiveservices-customvision-training/src/trainingAPIClientContext.ts +++ b/sdk/cognitiveservices/cognitiveservices-customvision-training/src/trainingAPIClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -11,7 +10,7 @@ import * as msRest from "@azure/ms-rest-js"; const packageName = "@azure/cognitiveservices-customvision-training"; -const packageVersion = "5.1.2"; +const packageVersion = "5.2.0"; export class TrainingAPIClientContext extends msRest.ServiceClient { endpoint: string; @@ -42,7 +41,7 @@ export class TrainingAPIClientContext extends msRest.ServiceClient { super(credentials, options); - this.baseUri = "{Endpoint}/customvision/v3.3/training"; + this.baseUri = "{Endpoint}/customvision/v3.4-preview/training"; this.requestContentType = "application/json; charset=utf-8"; this.endpoint = endpoint; this.credentials = credentials;