diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/README.md b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/README.md index b85e854d31f1..b8e61c3f0782 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/README.md +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/README.md @@ -1,22 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Custom Vision Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. +# Usage -## Usage - -For code examples, see [Custom -Vision](https://docs.microsoft.com/python/api/overview/azure/cognitive-services) +For code examples, see [Custom Vision](https://docs.microsoft.com/python/api/overview/azure/cognitive-services) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-vision-customvision%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-vision-customvision%2FREADME.png) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/__init__.py index 724dda495fae..9477c1b9fb76 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .custom_vision_training_client import CustomVisionTrainingClient -from .version import VERSION +from ._configuration import CustomVisionTrainingClientConfiguration +from ._custom_vision_training_client import CustomVisionTrainingClient +__all__ = ['CustomVisionTrainingClient', 'CustomVisionTrainingClientConfiguration'] -__all__ = ['CustomVisionTrainingClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/_configuration.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/_configuration.py new file mode 100644 index 000000000000..312e310eeab6 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/_configuration.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest import Configuration + +from .version import VERSION + + +class CustomVisionTrainingClientConfiguration(Configuration): + """Configuration for CustomVisionTrainingClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Supported Cognitive Services endpoints. + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + base_url = '{Endpoint}/customvision/v3.2/training' + + super(CustomVisionTrainingClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-cognitiveservices-vision-customvision/{}'.format(VERSION)) + + self.endpoint = endpoint + self.credentials = credentials diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/_custom_vision_training_client.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/_custom_vision_training_client.py new file mode 100644 index 000000000000..a995accbf5c8 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/_custom_vision_training_client.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import CustomVisionTrainingClientConfiguration +from .operations import CustomVisionTrainingClientOperationsMixin +from . import models + + +class CustomVisionTrainingClient(CustomVisionTrainingClientOperationsMixin, SDKClient): + """CustomVisionTrainingClient + + :ivar config: Configuration for client. + :vartype config: CustomVisionTrainingClientConfiguration + + :param endpoint: Supported Cognitive Services endpoints. + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + self.config = CustomVisionTrainingClientConfiguration(endpoint, credentials) + super(CustomVisionTrainingClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '3.2' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/__init__.py index ab6e9812583d..987b397f62fc 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/__init__.py @@ -10,146 +10,174 @@ # -------------------------------------------------------------------------- try: - from .domain_py3 import Domain - from .image_tag_create_entry_py3 import ImageTagCreateEntry - from .image_tag_create_batch_py3 import ImageTagCreateBatch - from .image_tag_create_summary_py3 import ImageTagCreateSummary - from .image_region_create_entry_py3 import ImageRegionCreateEntry - from .image_region_create_batch_py3 import ImageRegionCreateBatch - from .image_region_create_result_py3 import ImageRegionCreateResult - from .image_region_create_summary_py3 import ImageRegionCreateSummary - from .image_tag_py3 import ImageTag - from .image_region_py3 import ImageRegion - from .image_py3 import Image - from .image_create_result_py3 import ImageCreateResult - from .image_create_summary_py3 import ImageCreateSummary - from .region_py3 import Region - from .image_file_create_entry_py3 import ImageFileCreateEntry - from .image_file_create_batch_py3 import ImageFileCreateBatch - from .image_url_create_entry_py3 import ImageUrlCreateEntry - from .image_url_create_batch_py3 import ImageUrlCreateBatch - from .image_id_create_entry_py3 import ImageIdCreateEntry - from .image_id_create_batch_py3 import ImageIdCreateBatch - from .bounding_box_py3 import BoundingBox - from .region_proposal_py3 import RegionProposal - from .image_region_proposal_py3 import ImageRegionProposal - from .image_url_py3 import ImageUrl - from .prediction_py3 import Prediction - from .image_prediction_py3 import ImagePrediction - from .prediction_query_tag_py3 import PredictionQueryTag - from .prediction_query_token_py3 import PredictionQueryToken - from .stored_image_prediction_py3 import StoredImagePrediction - from .prediction_query_result_py3 import PredictionQueryResult - from .tag_performance_py3 import TagPerformance - from .iteration_performance_py3 import IterationPerformance - from .image_performance_py3 import ImagePerformance - from .project_settings_py3 import ProjectSettings - from .project_py3 import Project - from .iteration_py3 import Iteration - from .export_py3 import Export - from .tag_py3 import Tag - from .custom_vision_error_py3 import CustomVisionError, CustomVisionErrorException + from ._models_py3 import BoundingBox + from ._models_py3 import CustomVisionError, CustomVisionErrorException + from ._models_py3 import Domain + from ._models_py3 import Export + from ._models_py3 import Image + from ._models_py3 import ImageCreateResult + from ._models_py3 import ImageCreateSummary + from ._models_py3 import ImageFileCreateBatch + from ._models_py3 import ImageFileCreateEntry + from ._models_py3 import ImageIdCreateBatch + from ._models_py3 import ImageIdCreateEntry + from ._models_py3 import ImagePerformance + from ._models_py3 import ImagePrediction + from ._models_py3 import ImageProcessingSettings + from ._models_py3 import ImageRegion + from ._models_py3 import ImageRegionCreateBatch + from ._models_py3 import ImageRegionCreateEntry + from ._models_py3 import ImageRegionCreateResult + from ._models_py3 import ImageRegionCreateSummary + from ._models_py3 import ImageRegionProposal + from ._models_py3 import ImageTag + from ._models_py3 import ImageTagCreateBatch + from ._models_py3 import ImageTagCreateEntry + from ._models_py3 import ImageTagCreateSummary + from ._models_py3 import ImageUrl + from ._models_py3 import ImageUrlCreateBatch + from ._models_py3 import ImageUrlCreateEntry + from ._models_py3 import Iteration + from ._models_py3 import IterationPerformance + from ._models_py3 import Prediction + from ._models_py3 import PredictionQueryResult + from ._models_py3 import PredictionQueryTag + from ._models_py3 import PredictionQueryToken + from ._models_py3 import Project + from ._models_py3 import ProjectExport + from ._models_py3 import ProjectSettings + from ._models_py3 import Region + from ._models_py3 import RegionProposal + from ._models_py3 import StoredImagePrediction + from ._models_py3 import StoredSuggestedTagAndRegion + from ._models_py3 import SuggestedTagAndRegion + from ._models_py3 import SuggestedTagAndRegionQuery + from ._models_py3 import SuggestedTagAndRegionQueryToken + from ._models_py3 import Tag + from ._models_py3 import TagFilter + from ._models_py3 import TagPerformance + from ._models_py3 import TrainingParameters except (SyntaxError, ImportError): - from .domain import Domain - from .image_tag_create_entry import ImageTagCreateEntry - from .image_tag_create_batch import ImageTagCreateBatch - from .image_tag_create_summary import ImageTagCreateSummary - from .image_region_create_entry import ImageRegionCreateEntry - from .image_region_create_batch import ImageRegionCreateBatch - from .image_region_create_result import ImageRegionCreateResult - from .image_region_create_summary import ImageRegionCreateSummary - from .image_tag import ImageTag - from .image_region import ImageRegion - from .image import Image - from .image_create_result import ImageCreateResult - from .image_create_summary import ImageCreateSummary - from .region import Region - from .image_file_create_entry import ImageFileCreateEntry - from .image_file_create_batch import ImageFileCreateBatch - from .image_url_create_entry import ImageUrlCreateEntry - from .image_url_create_batch import ImageUrlCreateBatch - from .image_id_create_entry import ImageIdCreateEntry - from .image_id_create_batch import ImageIdCreateBatch - from .bounding_box import BoundingBox - from .region_proposal import RegionProposal - from .image_region_proposal import ImageRegionProposal - from .image_url import ImageUrl - from .prediction import Prediction - from .image_prediction import ImagePrediction - from .prediction_query_tag import PredictionQueryTag - from .prediction_query_token import PredictionQueryToken - from .stored_image_prediction import StoredImagePrediction - from .prediction_query_result import PredictionQueryResult - from .tag_performance import TagPerformance - from .iteration_performance import IterationPerformance - from .image_performance import ImagePerformance - from .project_settings import ProjectSettings - from .project import Project - from .iteration import Iteration - from .export import Export - from .tag import Tag - from .custom_vision_error import CustomVisionError, CustomVisionErrorException -from .custom_vision_training_client_enums import ( - DomainType, - ImageCreateStatus, - OrderBy, + from ._models import BoundingBox + from ._models import CustomVisionError, CustomVisionErrorException + from ._models import Domain + from ._models import Export + from ._models import Image + from ._models import ImageCreateResult + from ._models import ImageCreateSummary + from ._models import ImageFileCreateBatch + from ._models import ImageFileCreateEntry + from ._models import ImageIdCreateBatch + from ._models import ImageIdCreateEntry + from ._models import ImagePerformance + from ._models import ImagePrediction + from ._models import ImageProcessingSettings + from ._models import ImageRegion + from ._models import ImageRegionCreateBatch + from ._models import ImageRegionCreateEntry + from ._models import ImageRegionCreateResult + from ._models import ImageRegionCreateSummary + from ._models import ImageRegionProposal + from ._models import ImageTag + from ._models import ImageTagCreateBatch + from ._models import ImageTagCreateEntry + from ._models import ImageTagCreateSummary + from ._models import ImageUrl + from ._models import ImageUrlCreateBatch + from ._models import ImageUrlCreateEntry + from ._models import Iteration + from ._models import IterationPerformance + from ._models import Prediction + from ._models import PredictionQueryResult + from ._models import PredictionQueryTag + from ._models import PredictionQueryToken + from ._models import Project + from ._models import ProjectExport + from ._models import ProjectSettings + from ._models import Region + from ._models import RegionProposal + from ._models import StoredImagePrediction + from ._models import StoredSuggestedTagAndRegion + from ._models import SuggestedTagAndRegion + from ._models import SuggestedTagAndRegionQuery + from ._models import SuggestedTagAndRegionQueryToken + from ._models import Tag + from ._models import TagFilter + from ._models import TagPerformance + from ._models import TrainingParameters +from ._custom_vision_training_client_enums import ( Classifier, - TrainingType, + CustomVisionErrorCodes, + DomainType, + ExportFlavor, ExportPlatform, ExportStatus, - ExportFlavor, + ImageCreateStatus, + OrderBy, + ProjectStatus, + SortBy, TagType, - CustomVisionErrorCodes, + TrainingType, ) __all__ = [ + 'BoundingBox', + 'CustomVisionError', 'CustomVisionErrorException', 'Domain', - 'ImageTagCreateEntry', - 'ImageTagCreateBatch', - 'ImageTagCreateSummary', - 'ImageRegionCreateEntry', - 'ImageRegionCreateBatch', - 'ImageRegionCreateResult', - 'ImageRegionCreateSummary', - 'ImageTag', - 'ImageRegion', + 'Export', 'Image', 'ImageCreateResult', 'ImageCreateSummary', - 'Region', - 'ImageFileCreateEntry', 'ImageFileCreateBatch', - 'ImageUrlCreateEntry', - 'ImageUrlCreateBatch', - 'ImageIdCreateEntry', + 'ImageFileCreateEntry', 'ImageIdCreateBatch', - 'BoundingBox', - 'RegionProposal', + 'ImageIdCreateEntry', + 'ImagePerformance', + 'ImagePrediction', + 'ImageProcessingSettings', + 'ImageRegion', + 'ImageRegionCreateBatch', + 'ImageRegionCreateEntry', + 'ImageRegionCreateResult', + 'ImageRegionCreateSummary', 'ImageRegionProposal', + 'ImageTag', + 'ImageTagCreateBatch', + 'ImageTagCreateEntry', + 'ImageTagCreateSummary', 'ImageUrl', + 'ImageUrlCreateBatch', + 'ImageUrlCreateEntry', + 'Iteration', + 'IterationPerformance', 'Prediction', - 'ImagePrediction', + 'PredictionQueryResult', 'PredictionQueryTag', 'PredictionQueryToken', - 'StoredImagePrediction', - 'PredictionQueryResult', - 'TagPerformance', - 'IterationPerformance', - 'ImagePerformance', - 'ProjectSettings', 'Project', - 'Iteration', - 'Export', + 'ProjectExport', + 'ProjectSettings', + 'Region', + 'RegionProposal', + 'StoredImagePrediction', + 'StoredSuggestedTagAndRegion', + 'SuggestedTagAndRegion', + 'SuggestedTagAndRegionQuery', + 'SuggestedTagAndRegionQueryToken', 'Tag', - 'CustomVisionError', 'CustomVisionErrorException', + 'TagFilter', + 'TagPerformance', + 'TrainingParameters', + 'CustomVisionErrorCodes', 'DomainType', - 'ImageCreateStatus', - 'OrderBy', - 'Classifier', - 'TrainingType', 'ExportPlatform', 'ExportStatus', 'ExportFlavor', + 'ImageCreateStatus', + 'Classifier', + 'TrainingType', + 'OrderBy', + 'ProjectStatus', + 'SortBy', 'TagType', - 'CustomVisionErrorCodes', ] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_training_client_enums.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_custom_vision_training_client_enums.py similarity index 91% rename from sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_training_client_enums.py rename to sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_custom_vision_training_client_enums.py index c46b0dfbbcd2..8a23ddb1ad59 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_training_client_enums.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_custom_vision_training_client_enums.py @@ -12,77 +12,6 @@ from enum import Enum -class DomainType(str, Enum): - - classification = "Classification" - object_detection = "ObjectDetection" - - -class ImageCreateStatus(str, Enum): - - ok = "OK" - ok_duplicate = "OKDuplicate" - error_source = "ErrorSource" - error_image_format = "ErrorImageFormat" - error_image_size = "ErrorImageSize" - error_storage = "ErrorStorage" - error_limit_exceed = "ErrorLimitExceed" - error_tag_limit_exceed = "ErrorTagLimitExceed" - error_region_limit_exceed = "ErrorRegionLimitExceed" - error_unknown = "ErrorUnknown" - error_negative_and_regular_tag_on_same_image = "ErrorNegativeAndRegularTagOnSameImage" - - -class OrderBy(str, Enum): - - newest = "Newest" - oldest = "Oldest" - suggested = "Suggested" - - -class Classifier(str, Enum): - - multiclass = "Multiclass" - multilabel = "Multilabel" - - -class TrainingType(str, Enum): - - regular = "Regular" - advanced = "Advanced" - - -class ExportPlatform(str, Enum): - - core_ml = "CoreML" - tensor_flow = "TensorFlow" - docker_file = "DockerFile" - onnx = "ONNX" - vaidk = "VAIDK" - - -class ExportStatus(str, Enum): - - exporting = "Exporting" - failed = "Failed" - done = "Done" - - -class ExportFlavor(str, Enum): - - linux = "Linux" - windows = "Windows" - onnx10 = "ONNX10" - onnx12 = "ONNX12" - arm = "ARM" - - -class TagType(str, Enum): - - regular = "Regular" - negative = "Negative" - - class CustomVisionErrorCodes(str, Enum): no_error = "NoError" @@ -97,10 +26,13 @@ class CustomVisionErrorCodes(str, Enum): bad_request_project_unknown_classification = "BadRequestProjectUnknownClassification" bad_request_project_unsupported_domain_type_change = "BadRequestProjectUnsupportedDomainTypeChange" bad_request_project_unsupported_export_platform = "BadRequestProjectUnsupportedExportPlatform" + bad_request_project_image_preprocessing_settings = "BadRequestProjectImagePreprocessingSettings" + bad_request_project_duplicated = "BadRequestProjectDuplicated" bad_request_iteration_name = "BadRequestIterationName" bad_request_iteration_name_not_unique = "BadRequestIterationNameNotUnique" bad_request_iteration_description = "BadRequestIterationDescription" bad_request_iteration_is_not_trained = "BadRequestIterationIsNotTrained" + bad_request_iteration_validation_failed = "BadRequestIterationValidationFailed" bad_request_workspace_cannot_be_modified = "BadRequestWorkspaceCannotBeModified" bad_request_workspace_not_deletable = "BadRequestWorkspaceNotDeletable" bad_request_tag_name = "BadRequestTagName" @@ -152,6 +84,8 @@ class CustomVisionErrorCodes(str, Enum): bad_request_prediction_results_exceeded_count = "BadRequestPredictionResultsExceededCount" bad_request_prediction_invalid_application_name = "BadRequestPredictionInvalidApplicationName" bad_request_prediction_invalid_query_parameters = "BadRequestPredictionInvalidQueryParameters" + bad_request_invalid_import_token = "BadRequestInvalidImportToken" + bad_request_export_while_training = "BadRequestExportWhileTraining" bad_request_invalid = "BadRequestInvalid" unsupported_media_type = "UnsupportedMediaType" forbidden = "Forbidden" @@ -177,10 +111,13 @@ class CustomVisionErrorCodes(str, Enum): conflict = "Conflict" conflict_invalid = "ConflictInvalid" error_unknown = "ErrorUnknown" + error_iteration_copy_failed = "ErrorIterationCopyFailed" + error_prepare_performance_migration_failed = "ErrorPreparePerformanceMigrationFailed" error_project_invalid_workspace = "ErrorProjectInvalidWorkspace" error_project_invalid_pipeline_configuration = "ErrorProjectInvalidPipelineConfiguration" error_project_invalid_domain = "ErrorProjectInvalidDomain" error_project_training_request_failed = "ErrorProjectTrainingRequestFailed" + error_project_import_request_failed = "ErrorProjectImportRequestFailed" error_project_export_request_failed = "ErrorProjectExportRequestFailed" error_featurization_service_unavailable = "ErrorFeaturizationServiceUnavailable" error_featurization_queue_timeout = "ErrorFeaturizationQueueTimeout" @@ -198,3 +135,89 @@ class CustomVisionErrorCodes(str, Enum): error_prediction_storage = "ErrorPredictionStorage" error_region_proposal = "ErrorRegionProposal" error_invalid = "ErrorInvalid" + + +class DomainType(str, Enum): + + classification = "Classification" + object_detection = "ObjectDetection" + + +class ExportPlatform(str, Enum): + + core_ml = "CoreML" + tensor_flow = "TensorFlow" + docker_file = "DockerFile" + onnx = "ONNX" + vaidk = "VAIDK" + + +class ExportStatus(str, Enum): + + exporting = "Exporting" + failed = "Failed" + done = "Done" + + +class ExportFlavor(str, Enum): + + linux = "Linux" + windows = "Windows" + onnx10 = "ONNX10" + onnx12 = "ONNX12" + arm = "ARM" + tensor_flow_normal = "TensorFlowNormal" + tensor_flow_lite = "TensorFlowLite" + + +class ImageCreateStatus(str, Enum): + + ok = "OK" + ok_duplicate = "OKDuplicate" + error_source = "ErrorSource" + error_image_format = "ErrorImageFormat" + error_image_size = "ErrorImageSize" + error_storage = "ErrorStorage" + error_limit_exceed = "ErrorLimitExceed" + error_tag_limit_exceed = "ErrorTagLimitExceed" + error_region_limit_exceed = "ErrorRegionLimitExceed" + error_unknown = "ErrorUnknown" + error_negative_and_regular_tag_on_same_image = "ErrorNegativeAndRegularTagOnSameImage" + + +class Classifier(str, Enum): + + multiclass = "Multiclass" + multilabel = "Multilabel" + + +class TrainingType(str, Enum): + + regular = "Regular" + advanced = "Advanced" + + +class OrderBy(str, Enum): + + newest = "Newest" + oldest = "Oldest" + suggested = "Suggested" + + +class ProjectStatus(str, Enum): + + succeeded = "Succeeded" + importing = "Importing" + failed = "Failed" + + +class SortBy(str, Enum): + + uncertainty_ascending = "UncertaintyAscending" + uncertainty_descending = "UncertaintyDescending" + + +class TagType(str, Enum): + + regular = "Regular" + negative = "Negative" diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_models.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_models.py new file mode 100644 index 000000000000..03c972188bfc --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_models.py @@ -0,0 +1,1993 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class BoundingBox(Model): + """Bounding box that defines a region of an image. + + All required parameters must be populated in order to send to Azure. + + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(BoundingBox, self).__init__(**kwargs) + self.left = kwargs.get('left', None) + self.top = kwargs.get('top', None) + self.width = kwargs.get('width', None) + self.height = kwargs.get('height', None) + + +class CustomVisionError(Model): + """CustomVisionError. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. Possible values include: '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', 'BadRequestImageTags', + 'BadRequestImageRegions', 'BadRequestNegativeAndRegularTagOnSameImage', + 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', + 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', + 'BadRequestUnpublishFailed', 'BadRequestIterationNotPublished', + 'BadRequestSubscriptionApi', 'BadRequestExceedProjectLimit', + 'BadRequestExceedIterationPerProjectLimit', + 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', + 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', + 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', + 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', + 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', + 'BadRequestTrainingNotNeeded', + 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', + 'BadRequestTrainingValidationFailed', + 'BadRequestClassificationTrainingValidationFailed', + 'BadRequestMultiClassClassificationTrainingValidationFailed', + 'BadRequestMultiLabelClassificationTrainingValidationFailed', + 'BadRequestDetectionTrainingValidationFailed', + 'BadRequestTrainingAlreadyInProgress', + 'BadRequestDetectionTrainingNotAllowNegativeTag', + 'BadRequestInvalidEmailAddress', + 'BadRequestDomainNotSupportedForAdvancedTraining', + 'BadRequestExportPlatformNotSupportedForAdvancedTraining', + 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', + 'BadRequestPredictionTagsExceededCount', + 'BadRequestPredictionResultsExceededCount', + 'BadRequestPredictionInvalidApplicationName', + 'BadRequestPredictionInvalidQueryParameters', + 'BadRequestInvalidImportToken', 'BadRequestExportWhileTraining', + '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', 'ErrorInvalid' + :type code: str or + ~azure.cognitiveservices.vision.customvision.training.models.CustomVisionErrorCodes + :param message: Required. A message explaining the error reported by the + service. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomVisionError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class CustomVisionErrorException(HttpOperationError): + """Server responsed with exception of type: 'CustomVisionError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CustomVisionErrorException, self).__init__(deserialize, response, 'CustomVisionError', *args) + + +class Domain(Model): + """Domain. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar type: Possible values include: 'Classification', 'ObjectDetection' + :vartype type: str or + ~azure.cognitiveservices.vision.customvision.training.models.DomainType + :ivar exportable: + :vartype exportable: bool + :ivar enabled: + :vartype enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'exportable': {'readonly': True}, + 'enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'exportable': {'key': 'exportable', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Domain, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.exportable = None + self.enabled = None + + +class Export(Model): + """Export. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar platform: Platform of the export. Possible values include: 'CoreML', + 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' + :vartype platform: str or + ~azure.cognitiveservices.vision.customvision.training.models.ExportPlatform + :ivar status: Status of the export. Possible values include: 'Exporting', + 'Failed', 'Done' + :vartype status: str or + ~azure.cognitiveservices.vision.customvision.training.models.ExportStatus + :ivar download_uri: URI used to download the model. + :vartype download_uri: str + :ivar flavor: Flavor of the export. These are specializations of the + export platform. + Docker platform has valid flavors: Linux, Windows, ARM. + Tensorflow platform has valid flavors: TensorFlowNormal, TensorFlowLite. + ONNX platform has valid flavors: ONNX10, ONNX12. Possible values include: + 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM', 'TensorFlowNormal', + 'TensorFlowLite' + :vartype flavor: str or + ~azure.cognitiveservices.vision.customvision.training.models.ExportFlavor + :ivar newer_version_available: Indicates an updated version of the export + package is available and should be re-exported for the latest changes. + :vartype newer_version_available: bool + """ + + _validation = { + 'platform': {'readonly': True}, + 'status': {'readonly': True}, + 'download_uri': {'readonly': True}, + 'flavor': {'readonly': True}, + 'newer_version_available': {'readonly': True}, + } + + _attribute_map = { + 'platform': {'key': 'platform', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'download_uri': {'key': 'downloadUri', 'type': 'str'}, + 'flavor': {'key': 'flavor', 'type': 'str'}, + 'newer_version_available': {'key': 'newerVersionAvailable', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Export, self).__init__(**kwargs) + self.platform = None + self.status = None + self.download_uri = None + self.flavor = None + self.newer_version_available = None + + +class Image(Model): + """Image model to be sent as JSON. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Id of the image. + :vartype id: str + :ivar created: Date the image was created. + :vartype created: datetime + :ivar width: Width of the image. + :vartype width: int + :ivar height: Height of the image. + :vartype height: int + :ivar resized_image_uri: The URI to the (resized) image used for training. + :vartype resized_image_uri: str + :ivar thumbnail_uri: The URI to the thumbnail of the original image. + :vartype thumbnail_uri: str + :ivar original_image_uri: The URI to the original uploaded image. + :vartype original_image_uri: str + :ivar tags: Tags associated with this image. + :vartype tags: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTag] + :ivar regions: Regions associated with this image. + :vartype regions: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegion] + """ + + _validation = { + 'id': {'readonly': True}, + 'created': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'resized_image_uri': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'original_image_uri': {'readonly': True}, + 'tags': {'readonly': True}, + 'regions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[ImageTag]'}, + 'regions': {'key': 'regions', 'type': '[ImageRegion]'}, + } + + def __init__(self, **kwargs): + super(Image, self).__init__(**kwargs) + self.id = None + self.created = None + self.width = None + self.height = None + self.resized_image_uri = None + self.thumbnail_uri = None + self.original_image_uri = None + self.tags = None + self.regions = None + + +class ImageCreateResult(Model): + """ImageCreateResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar source_url: Source URL of the image. + :vartype source_url: str + :ivar status: Status of the image creation. Possible values include: 'OK', + 'OKDuplicate', 'ErrorSource', 'ErrorImageFormat', 'ErrorImageSize', + 'ErrorStorage', 'ErrorLimitExceed', 'ErrorTagLimitExceed', + 'ErrorRegionLimitExceed', 'ErrorUnknown', + 'ErrorNegativeAndRegularTagOnSameImage' + :vartype status: str or + ~azure.cognitiveservices.vision.customvision.training.models.ImageCreateStatus + :ivar image: The image. + :vartype image: + ~azure.cognitiveservices.vision.customvision.training.models.Image + """ + + _validation = { + 'source_url': {'readonly': True}, + 'status': {'readonly': True}, + 'image': {'readonly': True}, + } + + _attribute_map = { + 'source_url': {'key': 'sourceUrl', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'Image'}, + } + + def __init__(self, **kwargs): + super(ImageCreateResult, self).__init__(**kwargs) + self.source_url = None + self.status = None + self.image = None + + +class ImageCreateSummary(Model): + """ImageCreateSummary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_batch_successful: True if all of the images in the batch were + created successfully, otherwise false. + :vartype is_batch_successful: bool + :ivar images: List of the image creation results. + :vartype images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageCreateResult] + """ + + _validation = { + 'is_batch_successful': {'readonly': True}, + 'images': {'readonly': True}, + } + + _attribute_map = { + 'is_batch_successful': {'key': 'isBatchSuccessful', 'type': 'bool'}, + 'images': {'key': 'images', 'type': '[ImageCreateResult]'}, + } + + def __init__(self, **kwargs): + super(ImageCreateSummary, self).__init__(**kwargs) + self.is_batch_successful = None + self.images = None + + +class ImageFileCreateBatch(Model): + """ImageFileCreateBatch. + + :param images: + :type images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateEntry] + :param tag_ids: + :type tag_ids: list[str] + """ + + _attribute_map = { + 'images': {'key': 'images', 'type': '[ImageFileCreateEntry]'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ImageFileCreateBatch, self).__init__(**kwargs) + self.images = kwargs.get('images', None) + self.tag_ids = kwargs.get('tag_ids', None) + + +class ImageFileCreateEntry(Model): + """ImageFileCreateEntry. + + :param name: + :type name: str + :param contents: + :type contents: bytearray + :param tag_ids: + :type tag_ids: list[str] + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.Region] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'contents': {'key': 'contents', 'type': 'bytearray'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[Region]'}, + } + + def __init__(self, **kwargs): + super(ImageFileCreateEntry, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.contents = kwargs.get('contents', None) + self.tag_ids = kwargs.get('tag_ids', None) + self.regions = kwargs.get('regions', None) + + +class ImageIdCreateBatch(Model): + """ImageIdCreateBatch. + + :param images: + :type images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateEntry] + :param tag_ids: + :type tag_ids: list[str] + """ + + _attribute_map = { + 'images': {'key': 'images', 'type': '[ImageIdCreateEntry]'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ImageIdCreateBatch, self).__init__(**kwargs) + self.images = kwargs.get('images', None) + self.tag_ids = kwargs.get('tag_ids', None) + + +class ImageIdCreateEntry(Model): + """ImageIdCreateEntry. + + :param id: Id of the image. + :type id: str + :param tag_ids: + :type tag_ids: list[str] + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.Region] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[Region]'}, + } + + def __init__(self, **kwargs): + super(ImageIdCreateEntry, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.tag_ids = kwargs.get('tag_ids', None) + self.regions = kwargs.get('regions', None) + + +class ImagePerformance(Model): + """Image performance model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar predictions: + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + :ivar id: + :vartype id: str + :ivar created: + :vartype created: datetime + :ivar width: + :vartype width: int + :ivar height: + :vartype height: int + :ivar image_uri: + :vartype image_uri: str + :ivar thumbnail_uri: + :vartype thumbnail_uri: str + :ivar tags: + :vartype tags: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTag] + :ivar regions: + :vartype regions: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegion] + """ + + _validation = { + 'predictions': {'readonly': True}, + 'id': {'readonly': True}, + 'created': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'image_uri': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'tags': {'readonly': True}, + 'regions': {'readonly': True}, + } + + _attribute_map = { + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'image_uri': {'key': 'imageUri', 'type': 'str'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[ImageTag]'}, + 'regions': {'key': 'regions', 'type': '[ImageRegion]'}, + } + + def __init__(self, **kwargs): + super(ImagePerformance, self).__init__(**kwargs) + self.predictions = None + self.id = None + self.created = None + self.width = None + self.height = None + self.image_uri = None + self.thumbnail_uri = None + self.tags = None + self.regions = None + + +class ImagePrediction(Model): + """Result of an image prediction request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Prediction Id. + :vartype id: str + :ivar project: Project Id. + :vartype project: str + :ivar iteration: Iteration Id. + :vartype iteration: str + :ivar created: Date this prediction was created. + :vartype created: datetime + :ivar predictions: List of predictions. + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + """ + + _validation = { + 'id': {'readonly': True}, + 'project': {'readonly': True}, + 'iteration': {'readonly': True}, + 'created': {'readonly': True}, + 'predictions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'str'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + } + + def __init__(self, **kwargs): + super(ImagePrediction, self).__init__(**kwargs) + self.id = None + self.project = None + self.iteration = None + self.created = None + self.predictions = None + + +class ImageProcessingSettings(Model): + """Represents image preprocessing settings used by image augmentation. + + :param augmentation_methods: Gets or sets enabled image transforms. The + key corresponds to the transform name. If value is set to true, then + correspondent transform is enabled. Otherwise this transform will not be + used. + Augmentation will be uniformly distributed among enabled transforms. + :type augmentation_methods: dict[str, bool] + """ + + _attribute_map = { + 'augmentation_methods': {'key': 'augmentationMethods', 'type': '{bool}'}, + } + + def __init__(self, **kwargs): + super(ImageProcessingSettings, self).__init__(**kwargs) + self.augmentation_methods = kwargs.get('augmentation_methods', None) + + +class ImageRegion(Model): + """ImageRegion. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar region_id: + :vartype region_id: str + :ivar tag_name: + :vartype tag_name: str + :ivar created: + :vartype created: datetime + :param tag_id: Required. Id of the tag associated with this region. + :type tag_id: str + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'region_id': {'readonly': True}, + 'tag_name': {'readonly': True}, + 'created': {'readonly': True}, + 'tag_id': {'required': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'region_id': {'key': 'regionId', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ImageRegion, self).__init__(**kwargs) + self.region_id = None + self.tag_name = None + self.created = None + self.tag_id = kwargs.get('tag_id', None) + self.left = kwargs.get('left', None) + self.top = kwargs.get('top', None) + self.width = kwargs.get('width', None) + self.height = kwargs.get('height', None) + + +class ImageRegionCreateBatch(Model): + """Batch of image region information to create. + + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[ImageRegionCreateEntry]'}, + } + + def __init__(self, **kwargs): + super(ImageRegionCreateBatch, self).__init__(**kwargs) + self.regions = kwargs.get('regions', None) + + +class ImageRegionCreateEntry(Model): + """Entry associating a region to an image. + + All required parameters must be populated in order to send to Azure. + + :param image_id: Required. Id of the image. + :type image_id: str + :param tag_id: Required. Id of the tag associated with this region. + :type tag_id: str + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'image_id': {'required': True}, + 'tag_id': {'required': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ImageRegionCreateEntry, self).__init__(**kwargs) + self.image_id = kwargs.get('image_id', None) + self.tag_id = kwargs.get('tag_id', None) + self.left = kwargs.get('left', None) + self.top = kwargs.get('top', None) + self.width = kwargs.get('width', None) + self.height = kwargs.get('height', None) + + +class ImageRegionCreateResult(Model): + """ImageRegionCreateResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar image_id: + :vartype image_id: str + :ivar region_id: + :vartype region_id: str + :ivar tag_name: + :vartype tag_name: str + :ivar created: + :vartype created: datetime + :param tag_id: Required. Id of the tag associated with this region. + :type tag_id: str + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'image_id': {'readonly': True}, + 'region_id': {'readonly': True}, + 'tag_name': {'readonly': True}, + 'created': {'readonly': True}, + 'tag_id': {'required': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'region_id': {'key': 'regionId', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ImageRegionCreateResult, self).__init__(**kwargs) + self.image_id = None + self.region_id = None + self.tag_name = None + self.created = None + self.tag_id = kwargs.get('tag_id', None) + self.left = kwargs.get('left', None) + self.top = kwargs.get('top', None) + self.width = kwargs.get('width', None) + self.height = kwargs.get('height', None) + + +class ImageRegionCreateSummary(Model): + """ImageRegionCreateSummary. + + :param created: + :type created: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateResult] + :param duplicated: + :type duplicated: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] + :param exceeded: + :type exceeded: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] + """ + + _attribute_map = { + 'created': {'key': 'created', 'type': '[ImageRegionCreateResult]'}, + 'duplicated': {'key': 'duplicated', 'type': '[ImageRegionCreateEntry]'}, + 'exceeded': {'key': 'exceeded', 'type': '[ImageRegionCreateEntry]'}, + } + + def __init__(self, **kwargs): + super(ImageRegionCreateSummary, self).__init__(**kwargs) + self.created = kwargs.get('created', None) + self.duplicated = kwargs.get('duplicated', None) + self.exceeded = kwargs.get('exceeded', None) + + +class ImageRegionProposal(Model): + """ImageRegionProposal. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar project_id: + :vartype project_id: str + :ivar image_id: + :vartype image_id: str + :ivar proposals: + :vartype proposals: + list[~azure.cognitiveservices.vision.customvision.training.models.RegionProposal] + """ + + _validation = { + 'project_id': {'readonly': True}, + 'image_id': {'readonly': True}, + 'proposals': {'readonly': True}, + } + + _attribute_map = { + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'proposals': {'key': 'proposals', 'type': '[RegionProposal]'}, + } + + def __init__(self, **kwargs): + super(ImageRegionProposal, self).__init__(**kwargs) + self.project_id = None + self.image_id = None + self.proposals = None + + +class ImageTag(Model): + """ImageTag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag_id: + :vartype tag_id: str + :ivar tag_name: + :vartype tag_name: str + :ivar created: + :vartype created: datetime + """ + + _validation = { + 'tag_id': {'readonly': True}, + 'tag_name': {'readonly': True}, + 'created': {'readonly': True}, + } + + _attribute_map = { + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ImageTag, self).__init__(**kwargs) + self.tag_id = None + self.tag_name = None + self.created = None + + +class ImageTagCreateBatch(Model): + """Batch of image tags. + + :param tags: Image Tag entries to include in this batch. + :type tags: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '[ImageTagCreateEntry]'}, + } + + def __init__(self, **kwargs): + super(ImageTagCreateBatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ImageTagCreateEntry(Model): + """Entry associating a tag to an image. + + :param image_id: Id of the image. + :type image_id: str + :param tag_id: Id of the tag. + :type tag_id: str + """ + + _attribute_map = { + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImageTagCreateEntry, self).__init__(**kwargs) + self.image_id = kwargs.get('image_id', None) + self.tag_id = kwargs.get('tag_id', None) + + +class ImageTagCreateSummary(Model): + """ImageTagCreateSummary. + + :param created: + :type created: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] + :param duplicated: + :type duplicated: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] + :param exceeded: + :type exceeded: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] + """ + + _attribute_map = { + 'created': {'key': 'created', 'type': '[ImageTagCreateEntry]'}, + 'duplicated': {'key': 'duplicated', 'type': '[ImageTagCreateEntry]'}, + 'exceeded': {'key': 'exceeded', 'type': '[ImageTagCreateEntry]'}, + } + + def __init__(self, **kwargs): + super(ImageTagCreateSummary, self).__init__(**kwargs) + self.created = kwargs.get('created', None) + self.duplicated = kwargs.get('duplicated', None) + self.exceeded = kwargs.get('exceeded', None) + + +class ImageUrl(Model): + """Image url. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. Url of the image. + :type url: str + """ + + _validation = { + 'url': {'required': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImageUrl, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + + +class ImageUrlCreateBatch(Model): + """ImageUrlCreateBatch. + + :param images: + :type images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateEntry] + :param tag_ids: + :type tag_ids: list[str] + """ + + _attribute_map = { + 'images': {'key': 'images', 'type': '[ImageUrlCreateEntry]'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ImageUrlCreateBatch, self).__init__(**kwargs) + self.images = kwargs.get('images', None) + self.tag_ids = kwargs.get('tag_ids', None) + + +class ImageUrlCreateEntry(Model): + """ImageUrlCreateEntry. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. Url of the image. + :type url: str + :param tag_ids: + :type tag_ids: list[str] + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.Region] + """ + + _validation = { + 'url': {'required': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[Region]'}, + } + + def __init__(self, **kwargs): + super(ImageUrlCreateEntry, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + self.tag_ids = kwargs.get('tag_ids', None) + self.regions = kwargs.get('regions', None) + + +class Iteration(Model): + """Iteration model to be sent over JSON. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Gets the id of the iteration. + :vartype id: str + :param name: Required. Gets or sets the name of the iteration. + :type name: str + :ivar status: Gets the current iteration status. + :vartype status: str + :ivar created: Gets the time this iteration was completed. + :vartype created: datetime + :ivar last_modified: Gets the time this iteration was last modified. + :vartype last_modified: datetime + :ivar trained_at: Gets the time this iteration was last modified. + :vartype trained_at: datetime + :ivar project_id: Gets the project id of the iteration. + :vartype project_id: str + :ivar exportable: Whether the iteration can be exported to another format + for download. + :vartype exportable: bool + :ivar exportable_to: A set of platforms this iteration can export to. + :vartype exportable_to: list[str] + :ivar domain_id: Get or sets a guid of the domain the iteration has been + trained on. + :vartype domain_id: str + :ivar classification_type: Gets the classification type of the project. + Possible values include: 'Multiclass', 'Multilabel' + :vartype classification_type: str or + ~azure.cognitiveservices.vision.customvision.training.models.Classifier + :ivar training_type: Gets the training type of the iteration. Possible + values include: 'Regular', 'Advanced' + :vartype training_type: str or + ~azure.cognitiveservices.vision.customvision.training.models.TrainingType + :ivar reserved_budget_in_hours: Gets the reserved advanced training budget + for the iteration. + :vartype reserved_budget_in_hours: int + :ivar training_time_in_minutes: Gets the training time for the iteration. + :vartype training_time_in_minutes: int + :ivar publish_name: Name of the published model. + :vartype publish_name: str + :ivar original_publish_resource_id: Resource Provider Id this iteration + was originally published to. + :vartype original_publish_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'status': {'readonly': True}, + 'created': {'readonly': True}, + 'last_modified': {'readonly': True}, + 'trained_at': {'readonly': True}, + 'project_id': {'readonly': True}, + 'exportable': {'readonly': True}, + 'exportable_to': {'readonly': True}, + 'domain_id': {'readonly': True}, + 'classification_type': {'readonly': True}, + 'training_type': {'readonly': True}, + 'reserved_budget_in_hours': {'readonly': True}, + 'training_time_in_minutes': {'readonly': True}, + 'publish_name': {'readonly': True}, + 'original_publish_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'trained_at': {'key': 'trainedAt', 'type': 'iso-8601'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'exportable': {'key': 'exportable', 'type': 'bool'}, + 'exportable_to': {'key': 'exportableTo', 'type': '[str]'}, + 'domain_id': {'key': 'domainId', 'type': 'str'}, + 'classification_type': {'key': 'classificationType', 'type': 'str'}, + 'training_type': {'key': 'trainingType', 'type': 'str'}, + 'reserved_budget_in_hours': {'key': 'reservedBudgetInHours', 'type': 'int'}, + 'training_time_in_minutes': {'key': 'trainingTimeInMinutes', 'type': 'int'}, + 'publish_name': {'key': 'publishName', 'type': 'str'}, + 'original_publish_resource_id': {'key': 'originalPublishResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Iteration, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.status = None + self.created = None + self.last_modified = None + self.trained_at = None + self.project_id = None + self.exportable = None + self.exportable_to = None + self.domain_id = None + self.classification_type = None + self.training_type = None + self.reserved_budget_in_hours = None + self.training_time_in_minutes = None + self.publish_name = None + self.original_publish_resource_id = None + + +class IterationPerformance(Model): + """Represents the detailed performance data for a trained iteration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar per_tag_performance: Gets the per-tag performance details for this + iteration. + :vartype per_tag_performance: + list[~azure.cognitiveservices.vision.customvision.training.models.TagPerformance] + :ivar precision: Gets the precision. + :vartype precision: float + :ivar precision_std_deviation: Gets the standard deviation for the + precision. + :vartype precision_std_deviation: float + :ivar recall: Gets the recall. + :vartype recall: float + :ivar recall_std_deviation: Gets the standard deviation for the recall. + :vartype recall_std_deviation: float + :ivar average_precision: Gets the average precision when applicable. + :vartype average_precision: float + """ + + _validation = { + 'per_tag_performance': {'readonly': True}, + 'precision': {'readonly': True}, + 'precision_std_deviation': {'readonly': True}, + 'recall': {'readonly': True}, + 'recall_std_deviation': {'readonly': True}, + 'average_precision': {'readonly': True}, + } + + _attribute_map = { + 'per_tag_performance': {'key': 'perTagPerformance', 'type': '[TagPerformance]'}, + 'precision': {'key': 'precision', 'type': 'float'}, + 'precision_std_deviation': {'key': 'precisionStdDeviation', 'type': 'float'}, + 'recall': {'key': 'recall', 'type': 'float'}, + 'recall_std_deviation': {'key': 'recallStdDeviation', 'type': 'float'}, + 'average_precision': {'key': 'averagePrecision', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(IterationPerformance, self).__init__(**kwargs) + self.per_tag_performance = None + self.precision = None + self.precision_std_deviation = None + self.recall = None + self.recall_std_deviation = None + self.average_precision = None + + +class Prediction(Model): + """Prediction result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar probability: Probability of the tag. + :vartype probability: float + :ivar tag_id: Id of the predicted tag. + :vartype tag_id: str + :ivar tag_name: Name of the predicted tag. + :vartype tag_name: str + :ivar bounding_box: Bounding box of the prediction. + :vartype bounding_box: + ~azure.cognitiveservices.vision.customvision.training.models.BoundingBox + """ + + _validation = { + 'probability': {'readonly': True}, + 'tag_id': {'readonly': True}, + 'tag_name': {'readonly': True}, + 'bounding_box': {'readonly': True}, + } + + _attribute_map = { + 'probability': {'key': 'probability', 'type': 'float'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': 'BoundingBox'}, + } + + def __init__(self, **kwargs): + super(Prediction, self).__init__(**kwargs) + self.probability = None + self.tag_id = None + self.tag_name = None + self.bounding_box = None + + +class PredictionQueryResult(Model): + """Query result of the prediction images that were sent to your prediction + endpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param token: Prediction Query Token. + :type token: + ~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken + :ivar results: Result of an prediction request. + :vartype results: + list[~azure.cognitiveservices.vision.customvision.training.models.StoredImagePrediction] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'PredictionQueryToken'}, + 'results': {'key': 'results', 'type': '[StoredImagePrediction]'}, + } + + def __init__(self, **kwargs): + super(PredictionQueryResult, self).__init__(**kwargs) + self.token = kwargs.get('token', None) + self.results = None + + +class PredictionQueryTag(Model): + """PredictionQueryTag. + + :param id: + :type id: str + :param min_threshold: + :type min_threshold: float + :param max_threshold: + :type max_threshold: float + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'float'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(PredictionQueryTag, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.min_threshold = kwargs.get('min_threshold', None) + self.max_threshold = kwargs.get('max_threshold', None) + + +class PredictionQueryToken(Model): + """PredictionQueryToken. + + :param session: + :type session: str + :param continuation: + :type continuation: str + :param max_count: + :type max_count: int + :param order_by: Possible values include: 'Newest', 'Oldest', 'Suggested' + :type order_by: str or + ~azure.cognitiveservices.vision.customvision.training.models.OrderBy + :param tags: + :type tags: + list[~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryTag] + :param iteration_id: + :type iteration_id: str + :param start_time: + :type start_time: datetime + :param end_time: + :type end_time: datetime + :param application: + :type application: str + """ + + _attribute_map = { + 'session': {'key': 'session', 'type': 'str'}, + 'continuation': {'key': 'continuation', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'order_by': {'key': 'orderBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[PredictionQueryTag]'}, + 'iteration_id': {'key': 'iterationId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'application': {'key': 'application', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PredictionQueryToken, self).__init__(**kwargs) + self.session = kwargs.get('session', None) + self.continuation = kwargs.get('continuation', None) + self.max_count = kwargs.get('max_count', None) + self.order_by = kwargs.get('order_by', None) + self.tags = kwargs.get('tags', None) + self.iteration_id = kwargs.get('iteration_id', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.application = kwargs.get('application', None) + + +class Project(Model): + """Represents a project. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Gets the project id. + :vartype id: str + :param name: Required. Gets or sets the name of the project. + :type name: str + :param description: Required. Gets or sets the description of the project. + :type description: str + :param settings: Required. Gets or sets the project settings. + :type settings: + ~azure.cognitiveservices.vision.customvision.training.models.ProjectSettings + :ivar created: Gets the date this project was created. + :vartype created: datetime + :ivar last_modified: Gets the date this project was last modified. + :vartype last_modified: datetime + :ivar thumbnail_uri: Gets the thumbnail url representing the image. + :vartype thumbnail_uri: str + :ivar dr_mode_enabled: Gets if the Disaster Recovery (DR) mode is on, + indicating the project is temporarily read-only. + :vartype dr_mode_enabled: bool + :param status: Gets the status of the project. Possible values include: + 'Succeeded', 'Importing', 'Failed' + :type status: str or + ~azure.cognitiveservices.vision.customvision.training.models.ProjectStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'description': {'required': True}, + 'settings': {'required': True}, + 'created': {'readonly': True}, + 'last_modified': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'dr_mode_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'settings': {'key': 'settings', 'type': 'ProjectSettings'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'dr_mode_enabled': {'key': 'drModeEnabled', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Project, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.settings = kwargs.get('settings', None) + self.created = None + self.last_modified = None + self.thumbnail_uri = None + self.dr_mode_enabled = None + self.status = kwargs.get('status', None) + + +class ProjectExport(Model): + """Represents information about a project export. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar iteration_count: Count of iterations that will be exported. + :vartype iteration_count: int + :ivar image_count: Count of images that will be exported. + :vartype image_count: int + :ivar tag_count: Count of tags that will be exported. + :vartype tag_count: int + :ivar region_count: Count of regions that will be exported. + :vartype region_count: int + :ivar estimated_import_time_in_ms: Estimated time this project will take + to import, can change based on network connectivity and load between + source and destination regions. + :vartype estimated_import_time_in_ms: int + :ivar token: Opaque token that should be passed to ImportProject to + perform the import. This token grants access to import this + project to all that have the token. + :vartype token: str + """ + + _validation = { + 'iteration_count': {'readonly': True}, + 'image_count': {'readonly': True}, + 'tag_count': {'readonly': True}, + 'region_count': {'readonly': True}, + 'estimated_import_time_in_ms': {'readonly': True}, + 'token': {'readonly': True}, + } + + _attribute_map = { + 'iteration_count': {'key': 'iterationCount', 'type': 'int'}, + 'image_count': {'key': 'imageCount', 'type': 'int'}, + 'tag_count': {'key': 'tagCount', 'type': 'int'}, + 'region_count': {'key': 'regionCount', 'type': 'int'}, + 'estimated_import_time_in_ms': {'key': 'estimatedImportTimeInMS', 'type': 'int'}, + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProjectExport, self).__init__(**kwargs) + self.iteration_count = None + self.image_count = None + self.tag_count = None + self.region_count = None + self.estimated_import_time_in_ms = None + self.token = None + + +class ProjectSettings(Model): + """Represents settings associated with a project. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param domain_id: Gets or sets the id of the Domain to use with this + project. + :type domain_id: str + :param classification_type: Gets or sets the classification type of the + project. Possible values include: 'Multiclass', 'Multilabel' + :type classification_type: str or + ~azure.cognitiveservices.vision.customvision.training.models.Classifier + :param target_export_platforms: A list of ExportPlatform that the trained + model should be able to support. + :type target_export_platforms: list[str] + :ivar use_negative_set: Indicates if negative set is being used. + :vartype use_negative_set: bool + :ivar detection_parameters: Detection parameters in use, if any. + :vartype detection_parameters: str + :param image_processing_settings: Gets or sets image preprocessing + settings. + :type image_processing_settings: + ~azure.cognitiveservices.vision.customvision.training.models.ImageProcessingSettings + """ + + _validation = { + 'use_negative_set': {'readonly': True}, + 'detection_parameters': {'readonly': True}, + } + + _attribute_map = { + 'domain_id': {'key': 'domainId', 'type': 'str'}, + 'classification_type': {'key': 'classificationType', 'type': 'str'}, + 'target_export_platforms': {'key': 'targetExportPlatforms', 'type': '[str]'}, + 'use_negative_set': {'key': 'useNegativeSet', 'type': 'bool'}, + 'detection_parameters': {'key': 'detectionParameters', 'type': 'str'}, + 'image_processing_settings': {'key': 'imageProcessingSettings', 'type': 'ImageProcessingSettings'}, + } + + def __init__(self, **kwargs): + super(ProjectSettings, self).__init__(**kwargs) + self.domain_id = kwargs.get('domain_id', None) + self.classification_type = kwargs.get('classification_type', None) + self.target_export_platforms = kwargs.get('target_export_platforms', None) + self.use_negative_set = None + self.detection_parameters = None + self.image_processing_settings = kwargs.get('image_processing_settings', None) + + +class Region(Model): + """Region. + + All required parameters must be populated in order to send to Azure. + + :param tag_id: Required. Id of the tag associated with this region. + :type tag_id: str + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'tag_id': {'required': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(Region, self).__init__(**kwargs) + self.tag_id = kwargs.get('tag_id', None) + self.left = kwargs.get('left', None) + self.top = kwargs.get('top', None) + self.width = kwargs.get('width', None) + self.height = kwargs.get('height', None) + + +class RegionProposal(Model): + """RegionProposal. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar confidence: + :vartype confidence: float + :ivar bounding_box: + :vartype bounding_box: + ~azure.cognitiveservices.vision.customvision.training.models.BoundingBox + """ + + _validation = { + 'confidence': {'readonly': True}, + 'bounding_box': {'readonly': True}, + } + + _attribute_map = { + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'bounding_box': {'key': 'boundingBox', 'type': 'BoundingBox'}, + } + + def __init__(self, **kwargs): + super(RegionProposal, self).__init__(**kwargs) + self.confidence = None + self.bounding_box = None + + +class StoredImagePrediction(Model): + """Result of an image prediction request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resized_image_uri: The URI to the (resized) prediction image. + :vartype resized_image_uri: str + :ivar thumbnail_uri: The URI to the thumbnail of the original prediction + image. + :vartype thumbnail_uri: str + :ivar original_image_uri: The URI to the original prediction image. + :vartype original_image_uri: str + :ivar domain: Domain used for the prediction. + :vartype domain: str + :ivar id: Prediction Id. + :vartype id: str + :ivar project: Project Id. + :vartype project: str + :ivar iteration: Iteration Id. + :vartype iteration: str + :ivar created: Date this prediction was created. + :vartype created: datetime + :ivar predictions: List of predictions. + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + """ + + _validation = { + 'resized_image_uri': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'original_image_uri': {'readonly': True}, + 'domain': {'readonly': True}, + 'id': {'readonly': True}, + 'project': {'readonly': True}, + 'iteration': {'readonly': True}, + 'created': {'readonly': True}, + 'predictions': {'readonly': True}, + } + + _attribute_map = { + 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'str'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + } + + def __init__(self, **kwargs): + super(StoredImagePrediction, self).__init__(**kwargs) + self.resized_image_uri = None + self.thumbnail_uri = None + self.original_image_uri = None + self.domain = None + self.id = None + self.project = None + self.iteration = None + self.created = None + self.predictions = None + + +class StoredSuggestedTagAndRegion(Model): + """Result of a suggested tags and regions request of the untagged image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar width: Width of the resized image. + :vartype width: int + :ivar height: Height of the resized image. + :vartype height: int + :ivar resized_image_uri: The URI to the (resized) prediction image. + :vartype resized_image_uri: str + :ivar thumbnail_uri: The URI to the thumbnail of the original prediction + image. + :vartype thumbnail_uri: str + :ivar original_image_uri: The URI to the original prediction image. + :vartype original_image_uri: str + :ivar domain: Domain used for the prediction. + :vartype domain: str + :ivar id: Prediction Id. + :vartype id: str + :ivar project: Project Id. + :vartype project: str + :ivar iteration: Iteration Id. + :vartype iteration: str + :ivar created: Date this prediction was created. + :vartype created: datetime + :ivar predictions: List of predictions. + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + :ivar prediction_uncertainty: Uncertainty (entropy) of suggested tags or + regions per image. + :vartype prediction_uncertainty: float + """ + + _validation = { + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'resized_image_uri': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'original_image_uri': {'readonly': True}, + 'domain': {'readonly': True}, + 'id': {'readonly': True}, + 'project': {'readonly': True}, + 'iteration': {'readonly': True}, + 'created': {'readonly': True}, + 'predictions': {'readonly': True}, + 'prediction_uncertainty': {'readonly': True}, + } + + _attribute_map = { + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'str'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + 'prediction_uncertainty': {'key': 'predictionUncertainty', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(StoredSuggestedTagAndRegion, self).__init__(**kwargs) + self.width = None + self.height = None + self.resized_image_uri = None + self.thumbnail_uri = None + self.original_image_uri = None + self.domain = None + self.id = None + self.project = None + self.iteration = None + self.created = None + self.predictions = None + self.prediction_uncertainty = None + + +class SuggestedTagAndRegion(Model): + """Result of a suggested tags and regions request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Prediction Id. + :vartype id: str + :ivar project: Project Id. + :vartype project: str + :ivar iteration: Iteration Id. + :vartype iteration: str + :ivar created: Date this prediction was created. + :vartype created: datetime + :ivar predictions: List of predictions. + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + :ivar prediction_uncertainty: Uncertainty (entropy) of suggested tags or + regions per image. + :vartype prediction_uncertainty: float + """ + + _validation = { + 'id': {'readonly': True}, + 'project': {'readonly': True}, + 'iteration': {'readonly': True}, + 'created': {'readonly': True}, + 'predictions': {'readonly': True}, + 'prediction_uncertainty': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'str'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + 'prediction_uncertainty': {'key': 'predictionUncertainty', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(SuggestedTagAndRegion, self).__init__(**kwargs) + self.id = None + self.project = None + self.iteration = None + self.created = None + self.predictions = None + self.prediction_uncertainty = None + + +class SuggestedTagAndRegionQuery(Model): + """The array of result images and token containing session and continuation + Ids for the next query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param token: Contains properties we need to fetch suggested tags for. + :type token: + ~azure.cognitiveservices.vision.customvision.training.models.SuggestedTagAndRegionQueryToken + :ivar results: Result of a suggested tags and regions request of the + untagged image. + :vartype results: + list[~azure.cognitiveservices.vision.customvision.training.models.StoredSuggestedTagAndRegion] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'SuggestedTagAndRegionQueryToken'}, + 'results': {'key': 'results', 'type': '[StoredSuggestedTagAndRegion]'}, + } + + def __init__(self, **kwargs): + super(SuggestedTagAndRegionQuery, self).__init__(**kwargs) + self.token = kwargs.get('token', None) + self.results = None + + +class SuggestedTagAndRegionQueryToken(Model): + """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. + + :param tag_ids: Existing TagIds in project to filter suggested tags on. + :type tag_ids: list[str] + :param threshold: Confidence threshold to filter suggested tags on. + :type threshold: float + :param session: SessionId for database query. Initially set to null but + later used to paginate. + :type session: str + :param continuation: Continuation Id for database pagination. Initially + null but later used to paginate. + :type continuation: str + :param max_count: Maximum number of results you want to be returned in the + response. + :type max_count: int + :param sort_by: OrderBy. Ordering mechanism for your results. Possible + values include: 'UncertaintyAscending', 'UncertaintyDescending' + :type sort_by: str or + ~azure.cognitiveservices.vision.customvision.training.models.SortBy + """ + + _attribute_map = { + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'session': {'key': 'session', 'type': 'str'}, + 'continuation': {'key': 'continuation', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'sort_by': {'key': 'sortBy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SuggestedTagAndRegionQueryToken, self).__init__(**kwargs) + self.tag_ids = kwargs.get('tag_ids', None) + self.threshold = kwargs.get('threshold', None) + self.session = kwargs.get('session', None) + self.continuation = kwargs.get('continuation', None) + self.max_count = kwargs.get('max_count', None) + self.sort_by = kwargs.get('sort_by', None) + + +class Tag(Model): + """Represents a Tag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Gets the Tag ID. + :vartype id: str + :param name: Required. Gets or sets the name of the tag. + :type name: str + :param description: Required. Gets or sets the description of the tag. + :type description: str + :param type: Required. Gets or sets the type of the tag. Possible values + include: 'Regular', 'Negative' + :type type: str or + ~azure.cognitiveservices.vision.customvision.training.models.TagType + :ivar image_count: Gets the number of images with this tag. + :vartype image_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'description': {'required': True}, + 'type': {'required': True}, + 'image_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'image_count': {'key': 'imageCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Tag, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.type = kwargs.get('type', None) + self.image_count = None + + +class TagFilter(Model): + """Model that query for counting of images whose suggested tags match given + tags and their probability are greater than or equal to the given + threshold. + + :param tag_ids: Existing TagIds in project to get suggested tags count + for. + :type tag_ids: list[str] + :param threshold: Confidence threshold to filter suggested tags on. + :type threshold: float + """ + + _attribute_map = { + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(TagFilter, self).__init__(**kwargs) + self.tag_ids = kwargs.get('tag_ids', None) + self.threshold = kwargs.get('threshold', None) + + +class TagPerformance(Model): + """Represents performance data for a particular tag in a trained iteration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar precision: Gets the precision. + :vartype precision: float + :ivar precision_std_deviation: Gets the standard deviation for the + precision. + :vartype precision_std_deviation: float + :ivar recall: Gets the recall. + :vartype recall: float + :ivar recall_std_deviation: Gets the standard deviation for the recall. + :vartype recall_std_deviation: float + :ivar average_precision: Gets the average precision when applicable. + :vartype average_precision: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'precision': {'readonly': True}, + 'precision_std_deviation': {'readonly': True}, + 'recall': {'readonly': True}, + 'recall_std_deviation': {'readonly': True}, + 'average_precision': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'precision': {'key': 'precision', 'type': 'float'}, + 'precision_std_deviation': {'key': 'precisionStdDeviation', 'type': 'float'}, + 'recall': {'key': 'recall', 'type': 'float'}, + 'recall_std_deviation': {'key': 'recallStdDeviation', 'type': 'float'}, + 'average_precision': {'key': 'averagePrecision', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(TagPerformance, self).__init__(**kwargs) + self.id = None + self.name = None + self.precision = None + self.precision_std_deviation = None + self.recall = None + self.recall_std_deviation = None + self.average_precision = None + + +class TrainingParameters(Model): + """Parameters used for training. + + :param selected_tags: List of tags selected for this training session, + other tags in the project will be ignored. + :type selected_tags: list[str] + """ + + _attribute_map = { + 'selected_tags': {'key': 'selectedTags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(TrainingParameters, self).__init__(**kwargs) + self.selected_tags = kwargs.get('selected_tags', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_models_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_models_py3.py new file mode 100644 index 000000000000..8b0e1f518f20 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/_models_py3.py @@ -0,0 +1,1993 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class BoundingBox(Model): + """Bounding box that defines a region of an image. + + All required parameters must be populated in order to send to Azure. + + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, *, left: float, top: float, width: float, height: float, **kwargs) -> None: + super(BoundingBox, self).__init__(**kwargs) + self.left = left + self.top = top + self.width = width + self.height = height + + +class CustomVisionError(Model): + """CustomVisionError. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. Possible values include: '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', 'BadRequestImageTags', + 'BadRequestImageRegions', 'BadRequestNegativeAndRegularTagOnSameImage', + 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', + 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', + 'BadRequestUnpublishFailed', 'BadRequestIterationNotPublished', + 'BadRequestSubscriptionApi', 'BadRequestExceedProjectLimit', + 'BadRequestExceedIterationPerProjectLimit', + 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', + 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', + 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', + 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', + 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', + 'BadRequestTrainingNotNeeded', + 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', + 'BadRequestTrainingValidationFailed', + 'BadRequestClassificationTrainingValidationFailed', + 'BadRequestMultiClassClassificationTrainingValidationFailed', + 'BadRequestMultiLabelClassificationTrainingValidationFailed', + 'BadRequestDetectionTrainingValidationFailed', + 'BadRequestTrainingAlreadyInProgress', + 'BadRequestDetectionTrainingNotAllowNegativeTag', + 'BadRequestInvalidEmailAddress', + 'BadRequestDomainNotSupportedForAdvancedTraining', + 'BadRequestExportPlatformNotSupportedForAdvancedTraining', + 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', + 'BadRequestPredictionTagsExceededCount', + 'BadRequestPredictionResultsExceededCount', + 'BadRequestPredictionInvalidApplicationName', + 'BadRequestPredictionInvalidQueryParameters', + 'BadRequestInvalidImportToken', 'BadRequestExportWhileTraining', + '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', 'ErrorInvalid' + :type code: str or + ~azure.cognitiveservices.vision.customvision.training.models.CustomVisionErrorCodes + :param message: Required. A message explaining the error reported by the + service. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code, message: str, **kwargs) -> None: + super(CustomVisionError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class CustomVisionErrorException(HttpOperationError): + """Server responsed with exception of type: 'CustomVisionError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CustomVisionErrorException, self).__init__(deserialize, response, 'CustomVisionError', *args) + + +class Domain(Model): + """Domain. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar type: Possible values include: 'Classification', 'ObjectDetection' + :vartype type: str or + ~azure.cognitiveservices.vision.customvision.training.models.DomainType + :ivar exportable: + :vartype exportable: bool + :ivar enabled: + :vartype enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'exportable': {'readonly': True}, + 'enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'exportable': {'key': 'exportable', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(Domain, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.exportable = None + self.enabled = None + + +class Export(Model): + """Export. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar platform: Platform of the export. Possible values include: 'CoreML', + 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' + :vartype platform: str or + ~azure.cognitiveservices.vision.customvision.training.models.ExportPlatform + :ivar status: Status of the export. Possible values include: 'Exporting', + 'Failed', 'Done' + :vartype status: str or + ~azure.cognitiveservices.vision.customvision.training.models.ExportStatus + :ivar download_uri: URI used to download the model. + :vartype download_uri: str + :ivar flavor: Flavor of the export. These are specializations of the + export platform. + Docker platform has valid flavors: Linux, Windows, ARM. + Tensorflow platform has valid flavors: TensorFlowNormal, TensorFlowLite. + ONNX platform has valid flavors: ONNX10, ONNX12. Possible values include: + 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM', 'TensorFlowNormal', + 'TensorFlowLite' + :vartype flavor: str or + ~azure.cognitiveservices.vision.customvision.training.models.ExportFlavor + :ivar newer_version_available: Indicates an updated version of the export + package is available and should be re-exported for the latest changes. + :vartype newer_version_available: bool + """ + + _validation = { + 'platform': {'readonly': True}, + 'status': {'readonly': True}, + 'download_uri': {'readonly': True}, + 'flavor': {'readonly': True}, + 'newer_version_available': {'readonly': True}, + } + + _attribute_map = { + 'platform': {'key': 'platform', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'download_uri': {'key': 'downloadUri', 'type': 'str'}, + 'flavor': {'key': 'flavor', 'type': 'str'}, + 'newer_version_available': {'key': 'newerVersionAvailable', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(Export, self).__init__(**kwargs) + self.platform = None + self.status = None + self.download_uri = None + self.flavor = None + self.newer_version_available = None + + +class Image(Model): + """Image model to be sent as JSON. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Id of the image. + :vartype id: str + :ivar created: Date the image was created. + :vartype created: datetime + :ivar width: Width of the image. + :vartype width: int + :ivar height: Height of the image. + :vartype height: int + :ivar resized_image_uri: The URI to the (resized) image used for training. + :vartype resized_image_uri: str + :ivar thumbnail_uri: The URI to the thumbnail of the original image. + :vartype thumbnail_uri: str + :ivar original_image_uri: The URI to the original uploaded image. + :vartype original_image_uri: str + :ivar tags: Tags associated with this image. + :vartype tags: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTag] + :ivar regions: Regions associated with this image. + :vartype regions: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegion] + """ + + _validation = { + 'id': {'readonly': True}, + 'created': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'resized_image_uri': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'original_image_uri': {'readonly': True}, + 'tags': {'readonly': True}, + 'regions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[ImageTag]'}, + 'regions': {'key': 'regions', 'type': '[ImageRegion]'}, + } + + def __init__(self, **kwargs) -> None: + super(Image, self).__init__(**kwargs) + self.id = None + self.created = None + self.width = None + self.height = None + self.resized_image_uri = None + self.thumbnail_uri = None + self.original_image_uri = None + self.tags = None + self.regions = None + + +class ImageCreateResult(Model): + """ImageCreateResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar source_url: Source URL of the image. + :vartype source_url: str + :ivar status: Status of the image creation. Possible values include: 'OK', + 'OKDuplicate', 'ErrorSource', 'ErrorImageFormat', 'ErrorImageSize', + 'ErrorStorage', 'ErrorLimitExceed', 'ErrorTagLimitExceed', + 'ErrorRegionLimitExceed', 'ErrorUnknown', + 'ErrorNegativeAndRegularTagOnSameImage' + :vartype status: str or + ~azure.cognitiveservices.vision.customvision.training.models.ImageCreateStatus + :ivar image: The image. + :vartype image: + ~azure.cognitiveservices.vision.customvision.training.models.Image + """ + + _validation = { + 'source_url': {'readonly': True}, + 'status': {'readonly': True}, + 'image': {'readonly': True}, + } + + _attribute_map = { + 'source_url': {'key': 'sourceUrl', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'image': {'key': 'image', 'type': 'Image'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageCreateResult, self).__init__(**kwargs) + self.source_url = None + self.status = None + self.image = None + + +class ImageCreateSummary(Model): + """ImageCreateSummary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_batch_successful: True if all of the images in the batch were + created successfully, otherwise false. + :vartype is_batch_successful: bool + :ivar images: List of the image creation results. + :vartype images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageCreateResult] + """ + + _validation = { + 'is_batch_successful': {'readonly': True}, + 'images': {'readonly': True}, + } + + _attribute_map = { + 'is_batch_successful': {'key': 'isBatchSuccessful', 'type': 'bool'}, + 'images': {'key': 'images', 'type': '[ImageCreateResult]'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageCreateSummary, self).__init__(**kwargs) + self.is_batch_successful = None + self.images = None + + +class ImageFileCreateBatch(Model): + """ImageFileCreateBatch. + + :param images: + :type images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateEntry] + :param tag_ids: + :type tag_ids: list[str] + """ + + _attribute_map = { + 'images': {'key': 'images', 'type': '[ImageFileCreateEntry]'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + } + + def __init__(self, *, images=None, tag_ids=None, **kwargs) -> None: + super(ImageFileCreateBatch, self).__init__(**kwargs) + self.images = images + self.tag_ids = tag_ids + + +class ImageFileCreateEntry(Model): + """ImageFileCreateEntry. + + :param name: + :type name: str + :param contents: + :type contents: bytearray + :param tag_ids: + :type tag_ids: list[str] + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.Region] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'contents': {'key': 'contents', 'type': 'bytearray'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[Region]'}, + } + + def __init__(self, *, name: str=None, contents: bytearray=None, tag_ids=None, regions=None, **kwargs) -> None: + super(ImageFileCreateEntry, self).__init__(**kwargs) + self.name = name + self.contents = contents + self.tag_ids = tag_ids + self.regions = regions + + +class ImageIdCreateBatch(Model): + """ImageIdCreateBatch. + + :param images: + :type images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateEntry] + :param tag_ids: + :type tag_ids: list[str] + """ + + _attribute_map = { + 'images': {'key': 'images', 'type': '[ImageIdCreateEntry]'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + } + + def __init__(self, *, images=None, tag_ids=None, **kwargs) -> None: + super(ImageIdCreateBatch, self).__init__(**kwargs) + self.images = images + self.tag_ids = tag_ids + + +class ImageIdCreateEntry(Model): + """ImageIdCreateEntry. + + :param id: Id of the image. + :type id: str + :param tag_ids: + :type tag_ids: list[str] + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.Region] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[Region]'}, + } + + def __init__(self, *, id: str=None, tag_ids=None, regions=None, **kwargs) -> None: + super(ImageIdCreateEntry, self).__init__(**kwargs) + self.id = id + self.tag_ids = tag_ids + self.regions = regions + + +class ImagePerformance(Model): + """Image performance model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar predictions: + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + :ivar id: + :vartype id: str + :ivar created: + :vartype created: datetime + :ivar width: + :vartype width: int + :ivar height: + :vartype height: int + :ivar image_uri: + :vartype image_uri: str + :ivar thumbnail_uri: + :vartype thumbnail_uri: str + :ivar tags: + :vartype tags: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTag] + :ivar regions: + :vartype regions: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegion] + """ + + _validation = { + 'predictions': {'readonly': True}, + 'id': {'readonly': True}, + 'created': {'readonly': True}, + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'image_uri': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'tags': {'readonly': True}, + 'regions': {'readonly': True}, + } + + _attribute_map = { + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'image_uri': {'key': 'imageUri', 'type': 'str'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[ImageTag]'}, + 'regions': {'key': 'regions', 'type': '[ImageRegion]'}, + } + + def __init__(self, **kwargs) -> None: + super(ImagePerformance, self).__init__(**kwargs) + self.predictions = None + self.id = None + self.created = None + self.width = None + self.height = None + self.image_uri = None + self.thumbnail_uri = None + self.tags = None + self.regions = None + + +class ImagePrediction(Model): + """Result of an image prediction request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Prediction Id. + :vartype id: str + :ivar project: Project Id. + :vartype project: str + :ivar iteration: Iteration Id. + :vartype iteration: str + :ivar created: Date this prediction was created. + :vartype created: datetime + :ivar predictions: List of predictions. + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + """ + + _validation = { + 'id': {'readonly': True}, + 'project': {'readonly': True}, + 'iteration': {'readonly': True}, + 'created': {'readonly': True}, + 'predictions': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'str'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + } + + def __init__(self, **kwargs) -> None: + super(ImagePrediction, self).__init__(**kwargs) + self.id = None + self.project = None + self.iteration = None + self.created = None + self.predictions = None + + +class ImageProcessingSettings(Model): + """Represents image preprocessing settings used by image augmentation. + + :param augmentation_methods: Gets or sets enabled image transforms. The + key corresponds to the transform name. If value is set to true, then + correspondent transform is enabled. Otherwise this transform will not be + used. + Augmentation will be uniformly distributed among enabled transforms. + :type augmentation_methods: dict[str, bool] + """ + + _attribute_map = { + 'augmentation_methods': {'key': 'augmentationMethods', 'type': '{bool}'}, + } + + def __init__(self, *, augmentation_methods=None, **kwargs) -> None: + super(ImageProcessingSettings, self).__init__(**kwargs) + self.augmentation_methods = augmentation_methods + + +class ImageRegion(Model): + """ImageRegion. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar region_id: + :vartype region_id: str + :ivar tag_name: + :vartype tag_name: str + :ivar created: + :vartype created: datetime + :param tag_id: Required. Id of the tag associated with this region. + :type tag_id: str + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'region_id': {'readonly': True}, + 'tag_name': {'readonly': True}, + 'created': {'readonly': True}, + 'tag_id': {'required': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'region_id': {'key': 'regionId', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, *, tag_id: str, left: float, top: float, width: float, height: float, **kwargs) -> None: + super(ImageRegion, self).__init__(**kwargs) + self.region_id = None + self.tag_name = None + self.created = None + self.tag_id = tag_id + self.left = left + self.top = top + self.width = width + self.height = height + + +class ImageRegionCreateBatch(Model): + """Batch of image region information to create. + + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[ImageRegionCreateEntry]'}, + } + + def __init__(self, *, regions=None, **kwargs) -> None: + super(ImageRegionCreateBatch, self).__init__(**kwargs) + self.regions = regions + + +class ImageRegionCreateEntry(Model): + """Entry associating a region to an image. + + All required parameters must be populated in order to send to Azure. + + :param image_id: Required. Id of the image. + :type image_id: str + :param tag_id: Required. Id of the tag associated with this region. + :type tag_id: str + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'image_id': {'required': True}, + 'tag_id': {'required': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, *, image_id: str, tag_id: str, left: float, top: float, width: float, height: float, **kwargs) -> None: + super(ImageRegionCreateEntry, self).__init__(**kwargs) + self.image_id = image_id + self.tag_id = tag_id + self.left = left + self.top = top + self.width = width + self.height = height + + +class ImageRegionCreateResult(Model): + """ImageRegionCreateResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar image_id: + :vartype image_id: str + :ivar region_id: + :vartype region_id: str + :ivar tag_name: + :vartype tag_name: str + :ivar created: + :vartype created: datetime + :param tag_id: Required. Id of the tag associated with this region. + :type tag_id: str + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'image_id': {'readonly': True}, + 'region_id': {'readonly': True}, + 'tag_name': {'readonly': True}, + 'created': {'readonly': True}, + 'tag_id': {'required': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'region_id': {'key': 'regionId', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, *, tag_id: str, left: float, top: float, width: float, height: float, **kwargs) -> None: + super(ImageRegionCreateResult, self).__init__(**kwargs) + self.image_id = None + self.region_id = None + self.tag_name = None + self.created = None + self.tag_id = tag_id + self.left = left + self.top = top + self.width = width + self.height = height + + +class ImageRegionCreateSummary(Model): + """ImageRegionCreateSummary. + + :param created: + :type created: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateResult] + :param duplicated: + :type duplicated: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] + :param exceeded: + :type exceeded: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] + """ + + _attribute_map = { + 'created': {'key': 'created', 'type': '[ImageRegionCreateResult]'}, + 'duplicated': {'key': 'duplicated', 'type': '[ImageRegionCreateEntry]'}, + 'exceeded': {'key': 'exceeded', 'type': '[ImageRegionCreateEntry]'}, + } + + def __init__(self, *, created=None, duplicated=None, exceeded=None, **kwargs) -> None: + super(ImageRegionCreateSummary, self).__init__(**kwargs) + self.created = created + self.duplicated = duplicated + self.exceeded = exceeded + + +class ImageRegionProposal(Model): + """ImageRegionProposal. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar project_id: + :vartype project_id: str + :ivar image_id: + :vartype image_id: str + :ivar proposals: + :vartype proposals: + list[~azure.cognitiveservices.vision.customvision.training.models.RegionProposal] + """ + + _validation = { + 'project_id': {'readonly': True}, + 'image_id': {'readonly': True}, + 'proposals': {'readonly': True}, + } + + _attribute_map = { + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'proposals': {'key': 'proposals', 'type': '[RegionProposal]'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageRegionProposal, self).__init__(**kwargs) + self.project_id = None + self.image_id = None + self.proposals = None + + +class ImageTag(Model): + """ImageTag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag_id: + :vartype tag_id: str + :ivar tag_name: + :vartype tag_name: str + :ivar created: + :vartype created: datetime + """ + + _validation = { + 'tag_id': {'readonly': True}, + 'tag_name': {'readonly': True}, + 'created': {'readonly': True}, + } + + _attribute_map = { + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(ImageTag, self).__init__(**kwargs) + self.tag_id = None + self.tag_name = None + self.created = None + + +class ImageTagCreateBatch(Model): + """Batch of image tags. + + :param tags: Image Tag entries to include in this batch. + :type tags: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '[ImageTagCreateEntry]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ImageTagCreateBatch, self).__init__(**kwargs) + self.tags = tags + + +class ImageTagCreateEntry(Model): + """Entry associating a tag to an image. + + :param image_id: Id of the image. + :type image_id: str + :param tag_id: Id of the tag. + :type tag_id: str + """ + + _attribute_map = { + 'image_id': {'key': 'imageId', 'type': 'str'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + } + + def __init__(self, *, image_id: str=None, tag_id: str=None, **kwargs) -> None: + super(ImageTagCreateEntry, self).__init__(**kwargs) + self.image_id = image_id + self.tag_id = tag_id + + +class ImageTagCreateSummary(Model): + """ImageTagCreateSummary. + + :param created: + :type created: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] + :param duplicated: + :type duplicated: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] + :param exceeded: + :type exceeded: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] + """ + + _attribute_map = { + 'created': {'key': 'created', 'type': '[ImageTagCreateEntry]'}, + 'duplicated': {'key': 'duplicated', 'type': '[ImageTagCreateEntry]'}, + 'exceeded': {'key': 'exceeded', 'type': '[ImageTagCreateEntry]'}, + } + + def __init__(self, *, created=None, duplicated=None, exceeded=None, **kwargs) -> None: + super(ImageTagCreateSummary, self).__init__(**kwargs) + self.created = created + self.duplicated = duplicated + self.exceeded = exceeded + + +class ImageUrl(Model): + """Image url. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. Url of the image. + :type url: str + """ + + _validation = { + 'url': {'required': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, *, url: str, **kwargs) -> None: + super(ImageUrl, self).__init__(**kwargs) + self.url = url + + +class ImageUrlCreateBatch(Model): + """ImageUrlCreateBatch. + + :param images: + :type images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateEntry] + :param tag_ids: + :type tag_ids: list[str] + """ + + _attribute_map = { + 'images': {'key': 'images', 'type': '[ImageUrlCreateEntry]'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + } + + def __init__(self, *, images=None, tag_ids=None, **kwargs) -> None: + super(ImageUrlCreateBatch, self).__init__(**kwargs) + self.images = images + self.tag_ids = tag_ids + + +class ImageUrlCreateEntry(Model): + """ImageUrlCreateEntry. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. Url of the image. + :type url: str + :param tag_ids: + :type tag_ids: list[str] + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.Region] + """ + + _validation = { + 'url': {'required': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[Region]'}, + } + + def __init__(self, *, url: str, tag_ids=None, regions=None, **kwargs) -> None: + super(ImageUrlCreateEntry, self).__init__(**kwargs) + self.url = url + self.tag_ids = tag_ids + self.regions = regions + + +class Iteration(Model): + """Iteration model to be sent over JSON. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Gets the id of the iteration. + :vartype id: str + :param name: Required. Gets or sets the name of the iteration. + :type name: str + :ivar status: Gets the current iteration status. + :vartype status: str + :ivar created: Gets the time this iteration was completed. + :vartype created: datetime + :ivar last_modified: Gets the time this iteration was last modified. + :vartype last_modified: datetime + :ivar trained_at: Gets the time this iteration was last modified. + :vartype trained_at: datetime + :ivar project_id: Gets the project id of the iteration. + :vartype project_id: str + :ivar exportable: Whether the iteration can be exported to another format + for download. + :vartype exportable: bool + :ivar exportable_to: A set of platforms this iteration can export to. + :vartype exportable_to: list[str] + :ivar domain_id: Get or sets a guid of the domain the iteration has been + trained on. + :vartype domain_id: str + :ivar classification_type: Gets the classification type of the project. + Possible values include: 'Multiclass', 'Multilabel' + :vartype classification_type: str or + ~azure.cognitiveservices.vision.customvision.training.models.Classifier + :ivar training_type: Gets the training type of the iteration. Possible + values include: 'Regular', 'Advanced' + :vartype training_type: str or + ~azure.cognitiveservices.vision.customvision.training.models.TrainingType + :ivar reserved_budget_in_hours: Gets the reserved advanced training budget + for the iteration. + :vartype reserved_budget_in_hours: int + :ivar training_time_in_minutes: Gets the training time for the iteration. + :vartype training_time_in_minutes: int + :ivar publish_name: Name of the published model. + :vartype publish_name: str + :ivar original_publish_resource_id: Resource Provider Id this iteration + was originally published to. + :vartype original_publish_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'status': {'readonly': True}, + 'created': {'readonly': True}, + 'last_modified': {'readonly': True}, + 'trained_at': {'readonly': True}, + 'project_id': {'readonly': True}, + 'exportable': {'readonly': True}, + 'exportable_to': {'readonly': True}, + 'domain_id': {'readonly': True}, + 'classification_type': {'readonly': True}, + 'training_type': {'readonly': True}, + 'reserved_budget_in_hours': {'readonly': True}, + 'training_time_in_minutes': {'readonly': True}, + 'publish_name': {'readonly': True}, + 'original_publish_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'trained_at': {'key': 'trainedAt', 'type': 'iso-8601'}, + 'project_id': {'key': 'projectId', 'type': 'str'}, + 'exportable': {'key': 'exportable', 'type': 'bool'}, + 'exportable_to': {'key': 'exportableTo', 'type': '[str]'}, + 'domain_id': {'key': 'domainId', 'type': 'str'}, + 'classification_type': {'key': 'classificationType', 'type': 'str'}, + 'training_type': {'key': 'trainingType', 'type': 'str'}, + 'reserved_budget_in_hours': {'key': 'reservedBudgetInHours', 'type': 'int'}, + 'training_time_in_minutes': {'key': 'trainingTimeInMinutes', 'type': 'int'}, + 'publish_name': {'key': 'publishName', 'type': 'str'}, + 'original_publish_resource_id': {'key': 'originalPublishResourceId', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(Iteration, self).__init__(**kwargs) + self.id = None + self.name = name + self.status = None + self.created = None + self.last_modified = None + self.trained_at = None + self.project_id = None + self.exportable = None + self.exportable_to = None + self.domain_id = None + self.classification_type = None + self.training_type = None + self.reserved_budget_in_hours = None + self.training_time_in_minutes = None + self.publish_name = None + self.original_publish_resource_id = None + + +class IterationPerformance(Model): + """Represents the detailed performance data for a trained iteration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar per_tag_performance: Gets the per-tag performance details for this + iteration. + :vartype per_tag_performance: + list[~azure.cognitiveservices.vision.customvision.training.models.TagPerformance] + :ivar precision: Gets the precision. + :vartype precision: float + :ivar precision_std_deviation: Gets the standard deviation for the + precision. + :vartype precision_std_deviation: float + :ivar recall: Gets the recall. + :vartype recall: float + :ivar recall_std_deviation: Gets the standard deviation for the recall. + :vartype recall_std_deviation: float + :ivar average_precision: Gets the average precision when applicable. + :vartype average_precision: float + """ + + _validation = { + 'per_tag_performance': {'readonly': True}, + 'precision': {'readonly': True}, + 'precision_std_deviation': {'readonly': True}, + 'recall': {'readonly': True}, + 'recall_std_deviation': {'readonly': True}, + 'average_precision': {'readonly': True}, + } + + _attribute_map = { + 'per_tag_performance': {'key': 'perTagPerformance', 'type': '[TagPerformance]'}, + 'precision': {'key': 'precision', 'type': 'float'}, + 'precision_std_deviation': {'key': 'precisionStdDeviation', 'type': 'float'}, + 'recall': {'key': 'recall', 'type': 'float'}, + 'recall_std_deviation': {'key': 'recallStdDeviation', 'type': 'float'}, + 'average_precision': {'key': 'averagePrecision', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(IterationPerformance, self).__init__(**kwargs) + self.per_tag_performance = None + self.precision = None + self.precision_std_deviation = None + self.recall = None + self.recall_std_deviation = None + self.average_precision = None + + +class Prediction(Model): + """Prediction result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar probability: Probability of the tag. + :vartype probability: float + :ivar tag_id: Id of the predicted tag. + :vartype tag_id: str + :ivar tag_name: Name of the predicted tag. + :vartype tag_name: str + :ivar bounding_box: Bounding box of the prediction. + :vartype bounding_box: + ~azure.cognitiveservices.vision.customvision.training.models.BoundingBox + """ + + _validation = { + 'probability': {'readonly': True}, + 'tag_id': {'readonly': True}, + 'tag_name': {'readonly': True}, + 'bounding_box': {'readonly': True}, + } + + _attribute_map = { + 'probability': {'key': 'probability', 'type': 'float'}, + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + 'bounding_box': {'key': 'boundingBox', 'type': 'BoundingBox'}, + } + + def __init__(self, **kwargs) -> None: + super(Prediction, self).__init__(**kwargs) + self.probability = None + self.tag_id = None + self.tag_name = None + self.bounding_box = None + + +class PredictionQueryResult(Model): + """Query result of the prediction images that were sent to your prediction + endpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param token: Prediction Query Token. + :type token: + ~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken + :ivar results: Result of an prediction request. + :vartype results: + list[~azure.cognitiveservices.vision.customvision.training.models.StoredImagePrediction] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'PredictionQueryToken'}, + 'results': {'key': 'results', 'type': '[StoredImagePrediction]'}, + } + + def __init__(self, *, token=None, **kwargs) -> None: + super(PredictionQueryResult, self).__init__(**kwargs) + self.token = token + self.results = None + + +class PredictionQueryTag(Model): + """PredictionQueryTag. + + :param id: + :type id: str + :param min_threshold: + :type min_threshold: float + :param max_threshold: + :type max_threshold: float + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'float'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'float'}, + } + + def __init__(self, *, id: str=None, min_threshold: float=None, max_threshold: float=None, **kwargs) -> None: + super(PredictionQueryTag, self).__init__(**kwargs) + self.id = id + self.min_threshold = min_threshold + self.max_threshold = max_threshold + + +class PredictionQueryToken(Model): + """PredictionQueryToken. + + :param session: + :type session: str + :param continuation: + :type continuation: str + :param max_count: + :type max_count: int + :param order_by: Possible values include: 'Newest', 'Oldest', 'Suggested' + :type order_by: str or + ~azure.cognitiveservices.vision.customvision.training.models.OrderBy + :param tags: + :type tags: + list[~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryTag] + :param iteration_id: + :type iteration_id: str + :param start_time: + :type start_time: datetime + :param end_time: + :type end_time: datetime + :param application: + :type application: str + """ + + _attribute_map = { + 'session': {'key': 'session', 'type': 'str'}, + 'continuation': {'key': 'continuation', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'order_by': {'key': 'orderBy', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[PredictionQueryTag]'}, + 'iteration_id': {'key': 'iterationId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'application': {'key': 'application', 'type': 'str'}, + } + + def __init__(self, *, session: str=None, continuation: str=None, max_count: int=None, order_by=None, tags=None, iteration_id: str=None, start_time=None, end_time=None, application: str=None, **kwargs) -> None: + super(PredictionQueryToken, self).__init__(**kwargs) + self.session = session + self.continuation = continuation + self.max_count = max_count + self.order_by = order_by + self.tags = tags + self.iteration_id = iteration_id + self.start_time = start_time + self.end_time = end_time + self.application = application + + +class Project(Model): + """Represents a project. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Gets the project id. + :vartype id: str + :param name: Required. Gets or sets the name of the project. + :type name: str + :param description: Required. Gets or sets the description of the project. + :type description: str + :param settings: Required. Gets or sets the project settings. + :type settings: + ~azure.cognitiveservices.vision.customvision.training.models.ProjectSettings + :ivar created: Gets the date this project was created. + :vartype created: datetime + :ivar last_modified: Gets the date this project was last modified. + :vartype last_modified: datetime + :ivar thumbnail_uri: Gets the thumbnail url representing the image. + :vartype thumbnail_uri: str + :ivar dr_mode_enabled: Gets if the Disaster Recovery (DR) mode is on, + indicating the project is temporarily read-only. + :vartype dr_mode_enabled: bool + :param status: Gets the status of the project. Possible values include: + 'Succeeded', 'Importing', 'Failed' + :type status: str or + ~azure.cognitiveservices.vision.customvision.training.models.ProjectStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'description': {'required': True}, + 'settings': {'required': True}, + 'created': {'readonly': True}, + 'last_modified': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'dr_mode_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'settings': {'key': 'settings', 'type': 'ProjectSettings'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'dr_mode_enabled': {'key': 'drModeEnabled', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, name: str, description: str, settings, status=None, **kwargs) -> None: + super(Project, self).__init__(**kwargs) + self.id = None + self.name = name + self.description = description + self.settings = settings + self.created = None + self.last_modified = None + self.thumbnail_uri = None + self.dr_mode_enabled = None + self.status = status + + +class ProjectExport(Model): + """Represents information about a project export. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar iteration_count: Count of iterations that will be exported. + :vartype iteration_count: int + :ivar image_count: Count of images that will be exported. + :vartype image_count: int + :ivar tag_count: Count of tags that will be exported. + :vartype tag_count: int + :ivar region_count: Count of regions that will be exported. + :vartype region_count: int + :ivar estimated_import_time_in_ms: Estimated time this project will take + to import, can change based on network connectivity and load between + source and destination regions. + :vartype estimated_import_time_in_ms: int + :ivar token: Opaque token that should be passed to ImportProject to + perform the import. This token grants access to import this + project to all that have the token. + :vartype token: str + """ + + _validation = { + 'iteration_count': {'readonly': True}, + 'image_count': {'readonly': True}, + 'tag_count': {'readonly': True}, + 'region_count': {'readonly': True}, + 'estimated_import_time_in_ms': {'readonly': True}, + 'token': {'readonly': True}, + } + + _attribute_map = { + 'iteration_count': {'key': 'iterationCount', 'type': 'int'}, + 'image_count': {'key': 'imageCount', 'type': 'int'}, + 'tag_count': {'key': 'tagCount', 'type': 'int'}, + 'region_count': {'key': 'regionCount', 'type': 'int'}, + 'estimated_import_time_in_ms': {'key': 'estimatedImportTimeInMS', 'type': 'int'}, + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProjectExport, self).__init__(**kwargs) + self.iteration_count = None + self.image_count = None + self.tag_count = None + self.region_count = None + self.estimated_import_time_in_ms = None + self.token = None + + +class ProjectSettings(Model): + """Represents settings associated with a project. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param domain_id: Gets or sets the id of the Domain to use with this + project. + :type domain_id: str + :param classification_type: Gets or sets the classification type of the + project. Possible values include: 'Multiclass', 'Multilabel' + :type classification_type: str or + ~azure.cognitiveservices.vision.customvision.training.models.Classifier + :param target_export_platforms: A list of ExportPlatform that the trained + model should be able to support. + :type target_export_platforms: list[str] + :ivar use_negative_set: Indicates if negative set is being used. + :vartype use_negative_set: bool + :ivar detection_parameters: Detection parameters in use, if any. + :vartype detection_parameters: str + :param image_processing_settings: Gets or sets image preprocessing + settings. + :type image_processing_settings: + ~azure.cognitiveservices.vision.customvision.training.models.ImageProcessingSettings + """ + + _validation = { + 'use_negative_set': {'readonly': True}, + 'detection_parameters': {'readonly': True}, + } + + _attribute_map = { + 'domain_id': {'key': 'domainId', 'type': 'str'}, + 'classification_type': {'key': 'classificationType', 'type': 'str'}, + 'target_export_platforms': {'key': 'targetExportPlatforms', 'type': '[str]'}, + 'use_negative_set': {'key': 'useNegativeSet', 'type': 'bool'}, + 'detection_parameters': {'key': 'detectionParameters', 'type': 'str'}, + 'image_processing_settings': {'key': 'imageProcessingSettings', 'type': 'ImageProcessingSettings'}, + } + + def __init__(self, *, domain_id: str=None, classification_type=None, target_export_platforms=None, image_processing_settings=None, **kwargs) -> None: + super(ProjectSettings, self).__init__(**kwargs) + self.domain_id = domain_id + self.classification_type = classification_type + self.target_export_platforms = target_export_platforms + self.use_negative_set = None + self.detection_parameters = None + self.image_processing_settings = image_processing_settings + + +class Region(Model): + """Region. + + All required parameters must be populated in order to send to Azure. + + :param tag_id: Required. Id of the tag associated with this region. + :type tag_id: str + :param left: Required. Coordinate of the left boundary. + :type left: float + :param top: Required. Coordinate of the top boundary. + :type top: float + :param width: Required. Width. + :type width: float + :param height: Required. Height. + :type height: float + """ + + _validation = { + 'tag_id': {'required': True}, + 'left': {'required': True}, + 'top': {'required': True}, + 'width': {'required': True}, + 'height': {'required': True}, + } + + _attribute_map = { + 'tag_id': {'key': 'tagId', 'type': 'str'}, + 'left': {'key': 'left', 'type': 'float'}, + 'top': {'key': 'top', 'type': 'float'}, + 'width': {'key': 'width', 'type': 'float'}, + 'height': {'key': 'height', 'type': 'float'}, + } + + def __init__(self, *, tag_id: str, left: float, top: float, width: float, height: float, **kwargs) -> None: + super(Region, self).__init__(**kwargs) + self.tag_id = tag_id + self.left = left + self.top = top + self.width = width + self.height = height + + +class RegionProposal(Model): + """RegionProposal. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar confidence: + :vartype confidence: float + :ivar bounding_box: + :vartype bounding_box: + ~azure.cognitiveservices.vision.customvision.training.models.BoundingBox + """ + + _validation = { + 'confidence': {'readonly': True}, + 'bounding_box': {'readonly': True}, + } + + _attribute_map = { + 'confidence': {'key': 'confidence', 'type': 'float'}, + 'bounding_box': {'key': 'boundingBox', 'type': 'BoundingBox'}, + } + + def __init__(self, **kwargs) -> None: + super(RegionProposal, self).__init__(**kwargs) + self.confidence = None + self.bounding_box = None + + +class StoredImagePrediction(Model): + """Result of an image prediction request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resized_image_uri: The URI to the (resized) prediction image. + :vartype resized_image_uri: str + :ivar thumbnail_uri: The URI to the thumbnail of the original prediction + image. + :vartype thumbnail_uri: str + :ivar original_image_uri: The URI to the original prediction image. + :vartype original_image_uri: str + :ivar domain: Domain used for the prediction. + :vartype domain: str + :ivar id: Prediction Id. + :vartype id: str + :ivar project: Project Id. + :vartype project: str + :ivar iteration: Iteration Id. + :vartype iteration: str + :ivar created: Date this prediction was created. + :vartype created: datetime + :ivar predictions: List of predictions. + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + """ + + _validation = { + 'resized_image_uri': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'original_image_uri': {'readonly': True}, + 'domain': {'readonly': True}, + 'id': {'readonly': True}, + 'project': {'readonly': True}, + 'iteration': {'readonly': True}, + 'created': {'readonly': True}, + 'predictions': {'readonly': True}, + } + + _attribute_map = { + 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'str'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + } + + def __init__(self, **kwargs) -> None: + super(StoredImagePrediction, self).__init__(**kwargs) + self.resized_image_uri = None + self.thumbnail_uri = None + self.original_image_uri = None + self.domain = None + self.id = None + self.project = None + self.iteration = None + self.created = None + self.predictions = None + + +class StoredSuggestedTagAndRegion(Model): + """Result of a suggested tags and regions request of the untagged image. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar width: Width of the resized image. + :vartype width: int + :ivar height: Height of the resized image. + :vartype height: int + :ivar resized_image_uri: The URI to the (resized) prediction image. + :vartype resized_image_uri: str + :ivar thumbnail_uri: The URI to the thumbnail of the original prediction + image. + :vartype thumbnail_uri: str + :ivar original_image_uri: The URI to the original prediction image. + :vartype original_image_uri: str + :ivar domain: Domain used for the prediction. + :vartype domain: str + :ivar id: Prediction Id. + :vartype id: str + :ivar project: Project Id. + :vartype project: str + :ivar iteration: Iteration Id. + :vartype iteration: str + :ivar created: Date this prediction was created. + :vartype created: datetime + :ivar predictions: List of predictions. + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + :ivar prediction_uncertainty: Uncertainty (entropy) of suggested tags or + regions per image. + :vartype prediction_uncertainty: float + """ + + _validation = { + 'width': {'readonly': True}, + 'height': {'readonly': True}, + 'resized_image_uri': {'readonly': True}, + 'thumbnail_uri': {'readonly': True}, + 'original_image_uri': {'readonly': True}, + 'domain': {'readonly': True}, + 'id': {'readonly': True}, + 'project': {'readonly': True}, + 'iteration': {'readonly': True}, + 'created': {'readonly': True}, + 'predictions': {'readonly': True}, + 'prediction_uncertainty': {'readonly': True}, + } + + _attribute_map = { + 'width': {'key': 'width', 'type': 'int'}, + 'height': {'key': 'height', 'type': 'int'}, + 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, + 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, + 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'str'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + 'prediction_uncertainty': {'key': 'predictionUncertainty', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(StoredSuggestedTagAndRegion, self).__init__(**kwargs) + self.width = None + self.height = None + self.resized_image_uri = None + self.thumbnail_uri = None + self.original_image_uri = None + self.domain = None + self.id = None + self.project = None + self.iteration = None + self.created = None + self.predictions = None + self.prediction_uncertainty = None + + +class SuggestedTagAndRegion(Model): + """Result of a suggested tags and regions request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Prediction Id. + :vartype id: str + :ivar project: Project Id. + :vartype project: str + :ivar iteration: Iteration Id. + :vartype iteration: str + :ivar created: Date this prediction was created. + :vartype created: datetime + :ivar predictions: List of predictions. + :vartype predictions: + list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] + :ivar prediction_uncertainty: Uncertainty (entropy) of suggested tags or + regions per image. + :vartype prediction_uncertainty: float + """ + + _validation = { + 'id': {'readonly': True}, + 'project': {'readonly': True}, + 'iteration': {'readonly': True}, + 'created': {'readonly': True}, + 'predictions': {'readonly': True}, + 'prediction_uncertainty': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'project': {'key': 'project', 'type': 'str'}, + 'iteration': {'key': 'iteration', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'iso-8601'}, + 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, + 'prediction_uncertainty': {'key': 'predictionUncertainty', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(SuggestedTagAndRegion, self).__init__(**kwargs) + self.id = None + self.project = None + self.iteration = None + self.created = None + self.predictions = None + self.prediction_uncertainty = None + + +class SuggestedTagAndRegionQuery(Model): + """The array of result images and token containing session and continuation + Ids for the next query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param token: Contains properties we need to fetch suggested tags for. + :type token: + ~azure.cognitiveservices.vision.customvision.training.models.SuggestedTagAndRegionQueryToken + :ivar results: Result of a suggested tags and regions request of the + untagged image. + :vartype results: + list[~azure.cognitiveservices.vision.customvision.training.models.StoredSuggestedTagAndRegion] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'SuggestedTagAndRegionQueryToken'}, + 'results': {'key': 'results', 'type': '[StoredSuggestedTagAndRegion]'}, + } + + def __init__(self, *, token=None, **kwargs) -> None: + super(SuggestedTagAndRegionQuery, self).__init__(**kwargs) + self.token = token + self.results = None + + +class SuggestedTagAndRegionQueryToken(Model): + """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. + + :param tag_ids: Existing TagIds in project to filter suggested tags on. + :type tag_ids: list[str] + :param threshold: Confidence threshold to filter suggested tags on. + :type threshold: float + :param session: SessionId for database query. Initially set to null but + later used to paginate. + :type session: str + :param continuation: Continuation Id for database pagination. Initially + null but later used to paginate. + :type continuation: str + :param max_count: Maximum number of results you want to be returned in the + response. + :type max_count: int + :param sort_by: OrderBy. Ordering mechanism for your results. Possible + values include: 'UncertaintyAscending', 'UncertaintyDescending' + :type sort_by: str or + ~azure.cognitiveservices.vision.customvision.training.models.SortBy + """ + + _attribute_map = { + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'session': {'key': 'session', 'type': 'str'}, + 'continuation': {'key': 'continuation', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'sort_by': {'key': 'sortBy', 'type': 'str'}, + } + + def __init__(self, *, tag_ids=None, threshold: float=None, session: str=None, continuation: str=None, max_count: int=None, sort_by=None, **kwargs) -> None: + super(SuggestedTagAndRegionQueryToken, self).__init__(**kwargs) + self.tag_ids = tag_ids + self.threshold = threshold + self.session = session + self.continuation = continuation + self.max_count = max_count + self.sort_by = sort_by + + +class Tag(Model): + """Represents a Tag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Gets the Tag ID. + :vartype id: str + :param name: Required. Gets or sets the name of the tag. + :type name: str + :param description: Required. Gets or sets the description of the tag. + :type description: str + :param type: Required. Gets or sets the type of the tag. Possible values + include: 'Regular', 'Negative' + :type type: str or + ~azure.cognitiveservices.vision.customvision.training.models.TagType + :ivar image_count: Gets the number of images with this tag. + :vartype image_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'description': {'required': True}, + 'type': {'required': True}, + 'image_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'image_count': {'key': 'imageCount', 'type': 'int'}, + } + + def __init__(self, *, name: str, description: str, type, **kwargs) -> None: + super(Tag, self).__init__(**kwargs) + self.id = None + self.name = name + self.description = description + self.type = type + self.image_count = None + + +class TagFilter(Model): + """Model that query for counting of images whose suggested tags match given + tags and their probability are greater than or equal to the given + threshold. + + :param tag_ids: Existing TagIds in project to get suggested tags count + for. + :type tag_ids: list[str] + :param threshold: Confidence threshold to filter suggested tags on. + :type threshold: float + """ + + _attribute_map = { + 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + } + + def __init__(self, *, tag_ids=None, threshold: float=None, **kwargs) -> None: + super(TagFilter, self).__init__(**kwargs) + self.tag_ids = tag_ids + self.threshold = threshold + + +class TagPerformance(Model): + """Represents performance data for a particular tag in a trained iteration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar precision: Gets the precision. + :vartype precision: float + :ivar precision_std_deviation: Gets the standard deviation for the + precision. + :vartype precision_std_deviation: float + :ivar recall: Gets the recall. + :vartype recall: float + :ivar recall_std_deviation: Gets the standard deviation for the recall. + :vartype recall_std_deviation: float + :ivar average_precision: Gets the average precision when applicable. + :vartype average_precision: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'precision': {'readonly': True}, + 'precision_std_deviation': {'readonly': True}, + 'recall': {'readonly': True}, + 'recall_std_deviation': {'readonly': True}, + 'average_precision': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'precision': {'key': 'precision', 'type': 'float'}, + 'precision_std_deviation': {'key': 'precisionStdDeviation', 'type': 'float'}, + 'recall': {'key': 'recall', 'type': 'float'}, + 'recall_std_deviation': {'key': 'recallStdDeviation', 'type': 'float'}, + 'average_precision': {'key': 'averagePrecision', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(TagPerformance, self).__init__(**kwargs) + self.id = None + self.name = None + self.precision = None + self.precision_std_deviation = None + self.recall = None + self.recall_std_deviation = None + self.average_precision = None + + +class TrainingParameters(Model): + """Parameters used for training. + + :param selected_tags: List of tags selected for this training session, + other tags in the project will be ignored. + :type selected_tags: list[str] + """ + + _attribute_map = { + 'selected_tags': {'key': 'selectedTags', 'type': '[str]'}, + } + + def __init__(self, *, selected_tags=None, **kwargs) -> None: + super(TrainingParameters, self).__init__(**kwargs) + self.selected_tags = selected_tags diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/bounding_box.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/bounding_box.py deleted file mode 100644 index c5e07c1966a8..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/bounding_box.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BoundingBox(Model): - """Bounding box that defines a region of an image. - - All required parameters must be populated in order to send to Azure. - - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(BoundingBox, self).__init__(**kwargs) - self.left = kwargs.get('left', None) - self.top = kwargs.get('top', None) - self.width = kwargs.get('width', None) - self.height = kwargs.get('height', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/bounding_box_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/bounding_box_py3.py deleted file mode 100644 index 42627ed3ed3d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/bounding_box_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BoundingBox(Model): - """Bounding box that defines a region of an image. - - All required parameters must be populated in order to send to Azure. - - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, *, left: float, top: float, width: float, height: float, **kwargs) -> None: - super(BoundingBox, self).__init__(**kwargs) - self.left = left - self.top = top - self.width = width - self.height = height diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_error.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_error.py deleted file mode 100644 index b54ce1d0ba34..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_error.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class CustomVisionError(Model): - """CustomVisionError. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. The error code. Possible values include: 'NoError', - 'BadRequest', 'BadRequestExceededBatchSize', 'BadRequestNotSupported', - 'BadRequestInvalidIds', 'BadRequestProjectName', - 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', - 'BadRequestProjectUnknownDomain', - 'BadRequestProjectUnknownClassification', - 'BadRequestProjectUnsupportedDomainTypeChange', - 'BadRequestProjectUnsupportedExportPlatform', 'BadRequestIterationName', - 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', - 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', - 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', - 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', - 'BadRequestTagType', 'BadRequestMultipleNegativeTag', - 'BadRequestImageTags', 'BadRequestImageRegions', - 'BadRequestNegativeAndRegularTagOnSameImage', - 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', - 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', - 'BadRequestUnpublishFailed', 'BadRequestIterationNotPublished', - 'BadRequestSubscriptionApi', 'BadRequestExceedProjectLimit', - 'BadRequestExceedIterationPerProjectLimit', - 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', - 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', - 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', - 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', - 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', - 'BadRequestTrainingNotNeeded', - 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', - 'BadRequestTrainingValidationFailed', - 'BadRequestClassificationTrainingValidationFailed', - 'BadRequestMultiClassClassificationTrainingValidationFailed', - 'BadRequestMultiLabelClassificationTrainingValidationFailed', - 'BadRequestDetectionTrainingValidationFailed', - 'BadRequestTrainingAlreadyInProgress', - 'BadRequestDetectionTrainingNotAllowNegativeTag', - 'BadRequestInvalidEmailAddress', - 'BadRequestDomainNotSupportedForAdvancedTraining', - 'BadRequestExportPlatformNotSupportedForAdvancedTraining', - 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', - 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', - 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', - 'BadRequestPredictionTagsExceededCount', - 'BadRequestPredictionResultsExceededCount', - 'BadRequestPredictionInvalidApplicationName', - 'BadRequestPredictionInvalidQueryParameters', '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', - 'ErrorProjectInvalidWorkspace', - 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', - 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', - 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', - 'ErrorFeaturizationInvalidFeaturizer', - 'ErrorFeaturizationAugmentationUnavailable', - 'ErrorFeaturizationUnrecognizedJob', - 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', - 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', - 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', - 'ErrorPredictionModelNotCached', 'ErrorPrediction', - 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid' - :type code: str or - ~azure.cognitiveservices.vision.customvision.training.models.CustomVisionErrorCodes - :param message: Required. A message explaining the error reported by the - service. - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CustomVisionError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class CustomVisionErrorException(HttpOperationError): - """Server responsed with exception of type: 'CustomVisionError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CustomVisionErrorException, self).__init__(deserialize, response, 'CustomVisionError', *args) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_error_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_error_py3.py deleted file mode 100644 index 43a1110099a2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/custom_vision_error_py3.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class CustomVisionError(Model): - """CustomVisionError. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. The error code. Possible values include: 'NoError', - 'BadRequest', 'BadRequestExceededBatchSize', 'BadRequestNotSupported', - 'BadRequestInvalidIds', 'BadRequestProjectName', - 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', - 'BadRequestProjectUnknownDomain', - 'BadRequestProjectUnknownClassification', - 'BadRequestProjectUnsupportedDomainTypeChange', - 'BadRequestProjectUnsupportedExportPlatform', 'BadRequestIterationName', - 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', - 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', - 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', - 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', - 'BadRequestTagType', 'BadRequestMultipleNegativeTag', - 'BadRequestImageTags', 'BadRequestImageRegions', - 'BadRequestNegativeAndRegularTagOnSameImage', - 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', - 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', - 'BadRequestUnpublishFailed', 'BadRequestIterationNotPublished', - 'BadRequestSubscriptionApi', 'BadRequestExceedProjectLimit', - 'BadRequestExceedIterationPerProjectLimit', - 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', - 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', - 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', - 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', - 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', - 'BadRequestTrainingNotNeeded', - 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', - 'BadRequestTrainingValidationFailed', - 'BadRequestClassificationTrainingValidationFailed', - 'BadRequestMultiClassClassificationTrainingValidationFailed', - 'BadRequestMultiLabelClassificationTrainingValidationFailed', - 'BadRequestDetectionTrainingValidationFailed', - 'BadRequestTrainingAlreadyInProgress', - 'BadRequestDetectionTrainingNotAllowNegativeTag', - 'BadRequestInvalidEmailAddress', - 'BadRequestDomainNotSupportedForAdvancedTraining', - 'BadRequestExportPlatformNotSupportedForAdvancedTraining', - 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', - 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', - 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', - 'BadRequestPredictionTagsExceededCount', - 'BadRequestPredictionResultsExceededCount', - 'BadRequestPredictionInvalidApplicationName', - 'BadRequestPredictionInvalidQueryParameters', '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', - 'ErrorProjectInvalidWorkspace', - 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', - 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', - 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', - 'ErrorFeaturizationInvalidFeaturizer', - 'ErrorFeaturizationAugmentationUnavailable', - 'ErrorFeaturizationUnrecognizedJob', - 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', - 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', - 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', - 'ErrorPredictionModelNotCached', 'ErrorPrediction', - 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid' - :type code: str or - ~azure.cognitiveservices.vision.customvision.training.models.CustomVisionErrorCodes - :param message: Required. A message explaining the error reported by the - service. - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, code, message: str, **kwargs) -> None: - super(CustomVisionError, self).__init__(**kwargs) - self.code = code - self.message = message - - -class CustomVisionErrorException(HttpOperationError): - """Server responsed with exception of type: 'CustomVisionError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CustomVisionErrorException, self).__init__(deserialize, response, 'CustomVisionError', *args) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/domain.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/domain.py deleted file mode 100644 index 4995258a50f5..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/domain.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Domain(Model): - """Domain. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: - :vartype id: str - :ivar name: - :vartype name: str - :ivar type: Possible values include: 'Classification', 'ObjectDetection' - :vartype type: str or - ~azure.cognitiveservices.vision.customvision.training.models.DomainType - :ivar exportable: - :vartype exportable: bool - :ivar enabled: - :vartype enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'exportable': {'readonly': True}, - 'enabled': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'exportable': {'key': 'exportable', 'type': 'bool'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(Domain, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.exportable = None - self.enabled = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/domain_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/domain_py3.py deleted file mode 100644 index 7205a597ce7e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/domain_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Domain(Model): - """Domain. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: - :vartype id: str - :ivar name: - :vartype name: str - :ivar type: Possible values include: 'Classification', 'ObjectDetection' - :vartype type: str or - ~azure.cognitiveservices.vision.customvision.training.models.DomainType - :ivar exportable: - :vartype exportable: bool - :ivar enabled: - :vartype enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'exportable': {'readonly': True}, - 'enabled': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'exportable': {'key': 'exportable', 'type': 'bool'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs) -> None: - super(Domain, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.exportable = None - self.enabled = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/export.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/export.py deleted file mode 100644 index 3d5ef5d2eceb..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/export.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Export(Model): - """Export. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar platform: Platform of the export. Possible values include: 'CoreML', - 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' - :vartype platform: str or - ~azure.cognitiveservices.vision.customvision.training.models.ExportPlatform - :ivar status: Status of the export. Possible values include: 'Exporting', - 'Failed', 'Done' - :vartype status: str or - ~azure.cognitiveservices.vision.customvision.training.models.ExportStatus - :ivar download_uri: URI used to download the model. - :vartype download_uri: str - :ivar flavor: Flavor of the export. Possible values include: 'Linux', - 'Windows', 'ONNX10', 'ONNX12', 'ARM' - :vartype flavor: str or - ~azure.cognitiveservices.vision.customvision.training.models.ExportFlavor - :ivar newer_version_available: Indicates an updated version of the export - package is available and should be re-exported for the latest changes. - :vartype newer_version_available: bool - """ - - _validation = { - 'platform': {'readonly': True}, - 'status': {'readonly': True}, - 'download_uri': {'readonly': True}, - 'flavor': {'readonly': True}, - 'newer_version_available': {'readonly': True}, - } - - _attribute_map = { - 'platform': {'key': 'platform', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'download_uri': {'key': 'downloadUri', 'type': 'str'}, - 'flavor': {'key': 'flavor', 'type': 'str'}, - 'newer_version_available': {'key': 'newerVersionAvailable', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(Export, self).__init__(**kwargs) - self.platform = None - self.status = None - self.download_uri = None - self.flavor = None - self.newer_version_available = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/export_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/export_py3.py deleted file mode 100644 index 9fa39e68505d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/export_py3.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Export(Model): - """Export. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar platform: Platform of the export. Possible values include: 'CoreML', - 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' - :vartype platform: str or - ~azure.cognitiveservices.vision.customvision.training.models.ExportPlatform - :ivar status: Status of the export. Possible values include: 'Exporting', - 'Failed', 'Done' - :vartype status: str or - ~azure.cognitiveservices.vision.customvision.training.models.ExportStatus - :ivar download_uri: URI used to download the model. - :vartype download_uri: str - :ivar flavor: Flavor of the export. Possible values include: 'Linux', - 'Windows', 'ONNX10', 'ONNX12', 'ARM' - :vartype flavor: str or - ~azure.cognitiveservices.vision.customvision.training.models.ExportFlavor - :ivar newer_version_available: Indicates an updated version of the export - package is available and should be re-exported for the latest changes. - :vartype newer_version_available: bool - """ - - _validation = { - 'platform': {'readonly': True}, - 'status': {'readonly': True}, - 'download_uri': {'readonly': True}, - 'flavor': {'readonly': True}, - 'newer_version_available': {'readonly': True}, - } - - _attribute_map = { - 'platform': {'key': 'platform', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'download_uri': {'key': 'downloadUri', 'type': 'str'}, - 'flavor': {'key': 'flavor', 'type': 'str'}, - 'newer_version_available': {'key': 'newerVersionAvailable', 'type': 'bool'}, - } - - def __init__(self, **kwargs) -> None: - super(Export, self).__init__(**kwargs) - self.platform = None - self.status = None - self.download_uri = None - self.flavor = None - self.newer_version_available = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image.py deleted file mode 100644 index 3a20de328099..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Image(Model): - """Image model to be sent as JSON. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Id of the image. - :vartype id: str - :ivar created: Date the image was created. - :vartype created: datetime - :ivar width: Width of the image. - :vartype width: int - :ivar height: Height of the image. - :vartype height: int - :ivar resized_image_uri: The URI to the (resized) image used for training. - :vartype resized_image_uri: str - :ivar thumbnail_uri: The URI to the thumbnail of the original image. - :vartype thumbnail_uri: str - :ivar original_image_uri: The URI to the original uploaded image. - :vartype original_image_uri: str - :ivar tags: Tags associated with this image. - :vartype tags: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTag] - :ivar regions: Regions associated with this image. - :vartype regions: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegion] - """ - - _validation = { - 'id': {'readonly': True}, - 'created': {'readonly': True}, - 'width': {'readonly': True}, - 'height': {'readonly': True}, - 'resized_image_uri': {'readonly': True}, - 'thumbnail_uri': {'readonly': True}, - 'original_image_uri': {'readonly': True}, - 'tags': {'readonly': True}, - 'regions': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'width': {'key': 'width', 'type': 'int'}, - 'height': {'key': 'height', 'type': 'int'}, - 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, - 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, - 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '[ImageTag]'}, - 'regions': {'key': 'regions', 'type': '[ImageRegion]'}, - } - - def __init__(self, **kwargs): - super(Image, self).__init__(**kwargs) - self.id = None - self.created = None - self.width = None - self.height = None - self.resized_image_uri = None - self.thumbnail_uri = None - self.original_image_uri = None - self.tags = None - self.regions = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_result.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_result.py deleted file mode 100644 index f738ae6a93e0..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_result.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageCreateResult(Model): - """ImageCreateResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar source_url: Source URL of the image. - :vartype source_url: str - :ivar status: Status of the image creation. Possible values include: 'OK', - 'OKDuplicate', 'ErrorSource', 'ErrorImageFormat', 'ErrorImageSize', - 'ErrorStorage', 'ErrorLimitExceed', 'ErrorTagLimitExceed', - 'ErrorRegionLimitExceed', 'ErrorUnknown', - 'ErrorNegativeAndRegularTagOnSameImage' - :vartype status: str or - ~azure.cognitiveservices.vision.customvision.training.models.ImageCreateStatus - :ivar image: The image. - :vartype image: - ~azure.cognitiveservices.vision.customvision.training.models.Image - """ - - _validation = { - 'source_url': {'readonly': True}, - 'status': {'readonly': True}, - 'image': {'readonly': True}, - } - - _attribute_map = { - 'source_url': {'key': 'sourceUrl', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - } - - def __init__(self, **kwargs): - super(ImageCreateResult, self).__init__(**kwargs) - self.source_url = None - self.status = None - self.image = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_result_py3.py deleted file mode 100644 index 34faadbf28a7..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_result_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageCreateResult(Model): - """ImageCreateResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar source_url: Source URL of the image. - :vartype source_url: str - :ivar status: Status of the image creation. Possible values include: 'OK', - 'OKDuplicate', 'ErrorSource', 'ErrorImageFormat', 'ErrorImageSize', - 'ErrorStorage', 'ErrorLimitExceed', 'ErrorTagLimitExceed', - 'ErrorRegionLimitExceed', 'ErrorUnknown', - 'ErrorNegativeAndRegularTagOnSameImage' - :vartype status: str or - ~azure.cognitiveservices.vision.customvision.training.models.ImageCreateStatus - :ivar image: The image. - :vartype image: - ~azure.cognitiveservices.vision.customvision.training.models.Image - """ - - _validation = { - 'source_url': {'readonly': True}, - 'status': {'readonly': True}, - 'image': {'readonly': True}, - } - - _attribute_map = { - 'source_url': {'key': 'sourceUrl', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'image': {'key': 'image', 'type': 'Image'}, - } - - def __init__(self, **kwargs) -> None: - super(ImageCreateResult, self).__init__(**kwargs) - self.source_url = None - self.status = None - self.image = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_summary.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_summary.py deleted file mode 100644 index 6ce395a7cfe1..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_summary.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageCreateSummary(Model): - """ImageCreateSummary. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar is_batch_successful: True if all of the images in the batch were - created successfully, otherwise false. - :vartype is_batch_successful: bool - :ivar images: List of the image creation results. - :vartype images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageCreateResult] - """ - - _validation = { - 'is_batch_successful': {'readonly': True}, - 'images': {'readonly': True}, - } - - _attribute_map = { - 'is_batch_successful': {'key': 'isBatchSuccessful', 'type': 'bool'}, - 'images': {'key': 'images', 'type': '[ImageCreateResult]'}, - } - - def __init__(self, **kwargs): - super(ImageCreateSummary, self).__init__(**kwargs) - self.is_batch_successful = None - self.images = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_summary_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_summary_py3.py deleted file mode 100644 index 45b8394ca064..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_summary_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageCreateSummary(Model): - """ImageCreateSummary. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar is_batch_successful: True if all of the images in the batch were - created successfully, otherwise false. - :vartype is_batch_successful: bool - :ivar images: List of the image creation results. - :vartype images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageCreateResult] - """ - - _validation = { - 'is_batch_successful': {'readonly': True}, - 'images': {'readonly': True}, - } - - _attribute_map = { - 'is_batch_successful': {'key': 'isBatchSuccessful', 'type': 'bool'}, - 'images': {'key': 'images', 'type': '[ImageCreateResult]'}, - } - - def __init__(self, **kwargs) -> None: - super(ImageCreateSummary, self).__init__(**kwargs) - self.is_batch_successful = None - self.images = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_batch.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_batch.py deleted file mode 100644 index f040c7744a9b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_batch.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageFileCreateBatch(Model): - """ImageFileCreateBatch. - - :param images: - :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateEntry] - :param tag_ids: - :type tag_ids: list[str] - """ - - _attribute_map = { - 'images': {'key': 'images', 'type': '[ImageFileCreateEntry]'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ImageFileCreateBatch, self).__init__(**kwargs) - self.images = kwargs.get('images', None) - self.tag_ids = kwargs.get('tag_ids', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_batch_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_batch_py3.py deleted file mode 100644 index c099bec10f75..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_batch_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageFileCreateBatch(Model): - """ImageFileCreateBatch. - - :param images: - :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateEntry] - :param tag_ids: - :type tag_ids: list[str] - """ - - _attribute_map = { - 'images': {'key': 'images', 'type': '[ImageFileCreateEntry]'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - } - - def __init__(self, *, images=None, tag_ids=None, **kwargs) -> None: - super(ImageFileCreateBatch, self).__init__(**kwargs) - self.images = images - self.tag_ids = tag_ids diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_entry.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_entry.py deleted file mode 100644 index 670b3fb77f22..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_entry.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageFileCreateEntry(Model): - """ImageFileCreateEntry. - - :param name: - :type name: str - :param contents: - :type contents: bytearray - :param tag_ids: - :type tag_ids: list[str] - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.Region] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'contents': {'key': 'contents', 'type': 'bytearray'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - 'regions': {'key': 'regions', 'type': '[Region]'}, - } - - def __init__(self, **kwargs): - super(ImageFileCreateEntry, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.contents = kwargs.get('contents', None) - self.tag_ids = kwargs.get('tag_ids', None) - self.regions = kwargs.get('regions', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_entry_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_entry_py3.py deleted file mode 100644 index f823379d625a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_file_create_entry_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageFileCreateEntry(Model): - """ImageFileCreateEntry. - - :param name: - :type name: str - :param contents: - :type contents: bytearray - :param tag_ids: - :type tag_ids: list[str] - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.Region] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'contents': {'key': 'contents', 'type': 'bytearray'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - 'regions': {'key': 'regions', 'type': '[Region]'}, - } - - def __init__(self, *, name: str=None, contents: bytearray=None, tag_ids=None, regions=None, **kwargs) -> None: - super(ImageFileCreateEntry, self).__init__(**kwargs) - self.name = name - self.contents = contents - self.tag_ids = tag_ids - self.regions = regions diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_batch.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_batch.py deleted file mode 100644 index 75db24891c5d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_batch.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageIdCreateBatch(Model): - """ImageIdCreateBatch. - - :param images: - :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateEntry] - :param tag_ids: - :type tag_ids: list[str] - """ - - _attribute_map = { - 'images': {'key': 'images', 'type': '[ImageIdCreateEntry]'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ImageIdCreateBatch, self).__init__(**kwargs) - self.images = kwargs.get('images', None) - self.tag_ids = kwargs.get('tag_ids', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_batch_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_batch_py3.py deleted file mode 100644 index 75e2fc2a9333..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_batch_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageIdCreateBatch(Model): - """ImageIdCreateBatch. - - :param images: - :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateEntry] - :param tag_ids: - :type tag_ids: list[str] - """ - - _attribute_map = { - 'images': {'key': 'images', 'type': '[ImageIdCreateEntry]'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - } - - def __init__(self, *, images=None, tag_ids=None, **kwargs) -> None: - super(ImageIdCreateBatch, self).__init__(**kwargs) - self.images = images - self.tag_ids = tag_ids diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_entry.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_entry.py deleted file mode 100644 index eb529f19dd60..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_entry.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageIdCreateEntry(Model): - """ImageIdCreateEntry. - - :param id: Id of the image. - :type id: str - :param tag_ids: - :type tag_ids: list[str] - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.Region] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - 'regions': {'key': 'regions', 'type': '[Region]'}, - } - - def __init__(self, **kwargs): - super(ImageIdCreateEntry, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.tag_ids = kwargs.get('tag_ids', None) - self.regions = kwargs.get('regions', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_entry_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_entry_py3.py deleted file mode 100644 index 81e457ef9e2b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_id_create_entry_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageIdCreateEntry(Model): - """ImageIdCreateEntry. - - :param id: Id of the image. - :type id: str - :param tag_ids: - :type tag_ids: list[str] - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.Region] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - 'regions': {'key': 'regions', 'type': '[Region]'}, - } - - def __init__(self, *, id: str=None, tag_ids=None, regions=None, **kwargs) -> None: - super(ImageIdCreateEntry, self).__init__(**kwargs) - self.id = id - self.tag_ids = tag_ids - self.regions = regions diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_performance.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_performance.py deleted file mode 100644 index 2c6a6f098309..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_performance.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImagePerformance(Model): - """Image performance model. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar predictions: - :vartype predictions: - list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] - :ivar id: - :vartype id: str - :ivar created: - :vartype created: datetime - :ivar width: - :vartype width: int - :ivar height: - :vartype height: int - :ivar image_uri: - :vartype image_uri: str - :ivar thumbnail_uri: - :vartype thumbnail_uri: str - :ivar tags: - :vartype tags: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTag] - :ivar regions: - :vartype regions: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegion] - """ - - _validation = { - 'predictions': {'readonly': True}, - 'id': {'readonly': True}, - 'created': {'readonly': True}, - 'width': {'readonly': True}, - 'height': {'readonly': True}, - 'image_uri': {'readonly': True}, - 'thumbnail_uri': {'readonly': True}, - 'tags': {'readonly': True}, - 'regions': {'readonly': True}, - } - - _attribute_map = { - 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, - 'id': {'key': 'id', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'width': {'key': 'width', 'type': 'int'}, - 'height': {'key': 'height', 'type': 'int'}, - 'image_uri': {'key': 'imageUri', 'type': 'str'}, - 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '[ImageTag]'}, - 'regions': {'key': 'regions', 'type': '[ImageRegion]'}, - } - - def __init__(self, **kwargs): - super(ImagePerformance, self).__init__(**kwargs) - self.predictions = None - self.id = None - self.created = None - self.width = None - self.height = None - self.image_uri = None - self.thumbnail_uri = None - self.tags = None - self.regions = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_performance_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_performance_py3.py deleted file mode 100644 index 809ee29ce16b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_performance_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImagePerformance(Model): - """Image performance model. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar predictions: - :vartype predictions: - list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] - :ivar id: - :vartype id: str - :ivar created: - :vartype created: datetime - :ivar width: - :vartype width: int - :ivar height: - :vartype height: int - :ivar image_uri: - :vartype image_uri: str - :ivar thumbnail_uri: - :vartype thumbnail_uri: str - :ivar tags: - :vartype tags: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTag] - :ivar regions: - :vartype regions: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegion] - """ - - _validation = { - 'predictions': {'readonly': True}, - 'id': {'readonly': True}, - 'created': {'readonly': True}, - 'width': {'readonly': True}, - 'height': {'readonly': True}, - 'image_uri': {'readonly': True}, - 'thumbnail_uri': {'readonly': True}, - 'tags': {'readonly': True}, - 'regions': {'readonly': True}, - } - - _attribute_map = { - 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, - 'id': {'key': 'id', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'width': {'key': 'width', 'type': 'int'}, - 'height': {'key': 'height', 'type': 'int'}, - 'image_uri': {'key': 'imageUri', 'type': 'str'}, - 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '[ImageTag]'}, - 'regions': {'key': 'regions', 'type': '[ImageRegion]'}, - } - - def __init__(self, **kwargs) -> None: - super(ImagePerformance, self).__init__(**kwargs) - self.predictions = None - self.id = None - self.created = None - self.width = None - self.height = None - self.image_uri = None - self.thumbnail_uri = None - self.tags = None - self.regions = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_prediction.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_prediction.py deleted file mode 100644 index 7f5dcfad6570..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_prediction.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImagePrediction(Model): - """Result of an image prediction request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Prediction Id. - :vartype id: str - :ivar project: Project Id. - :vartype project: str - :ivar iteration: Iteration Id. - :vartype iteration: str - :ivar created: Date this prediction was created. - :vartype created: datetime - :ivar predictions: List of predictions. - :vartype predictions: - list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] - """ - - _validation = { - 'id': {'readonly': True}, - 'project': {'readonly': True}, - 'iteration': {'readonly': True}, - 'created': {'readonly': True}, - 'predictions': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'project': {'key': 'project', 'type': 'str'}, - 'iteration': {'key': 'iteration', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, - } - - def __init__(self, **kwargs): - super(ImagePrediction, self).__init__(**kwargs) - self.id = None - self.project = None - self.iteration = None - self.created = None - self.predictions = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_prediction_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_prediction_py3.py deleted file mode 100644 index 420a028358a4..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_prediction_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImagePrediction(Model): - """Result of an image prediction request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Prediction Id. - :vartype id: str - :ivar project: Project Id. - :vartype project: str - :ivar iteration: Iteration Id. - :vartype iteration: str - :ivar created: Date this prediction was created. - :vartype created: datetime - :ivar predictions: List of predictions. - :vartype predictions: - list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] - """ - - _validation = { - 'id': {'readonly': True}, - 'project': {'readonly': True}, - 'iteration': {'readonly': True}, - 'created': {'readonly': True}, - 'predictions': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'project': {'key': 'project', 'type': 'str'}, - 'iteration': {'key': 'iteration', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, - } - - def __init__(self, **kwargs) -> None: - super(ImagePrediction, self).__init__(**kwargs) - self.id = None - self.project = None - self.iteration = None - self.created = None - self.predictions = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_py3.py deleted file mode 100644 index 79340062ce9e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_py3.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Image(Model): - """Image model to be sent as JSON. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Id of the image. - :vartype id: str - :ivar created: Date the image was created. - :vartype created: datetime - :ivar width: Width of the image. - :vartype width: int - :ivar height: Height of the image. - :vartype height: int - :ivar resized_image_uri: The URI to the (resized) image used for training. - :vartype resized_image_uri: str - :ivar thumbnail_uri: The URI to the thumbnail of the original image. - :vartype thumbnail_uri: str - :ivar original_image_uri: The URI to the original uploaded image. - :vartype original_image_uri: str - :ivar tags: Tags associated with this image. - :vartype tags: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTag] - :ivar regions: Regions associated with this image. - :vartype regions: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegion] - """ - - _validation = { - 'id': {'readonly': True}, - 'created': {'readonly': True}, - 'width': {'readonly': True}, - 'height': {'readonly': True}, - 'resized_image_uri': {'readonly': True}, - 'thumbnail_uri': {'readonly': True}, - 'original_image_uri': {'readonly': True}, - 'tags': {'readonly': True}, - 'regions': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'width': {'key': 'width', 'type': 'int'}, - 'height': {'key': 'height', 'type': 'int'}, - 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, - 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, - 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '[ImageTag]'}, - 'regions': {'key': 'regions', 'type': '[ImageRegion]'}, - } - - def __init__(self, **kwargs) -> None: - super(Image, self).__init__(**kwargs) - self.id = None - self.created = None - self.width = None - self.height = None - self.resized_image_uri = None - self.thumbnail_uri = None - self.original_image_uri = None - self.tags = None - self.regions = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region.py deleted file mode 100644 index 60c830eeb634..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegion(Model): - """ImageRegion. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar region_id: - :vartype region_id: str - :ivar tag_name: - :vartype tag_name: str - :ivar created: - :vartype created: datetime - :param tag_id: Required. Id of the tag associated with this region. - :type tag_id: str - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'region_id': {'readonly': True}, - 'tag_name': {'readonly': True}, - 'created': {'readonly': True}, - 'tag_id': {'required': True}, - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'region_id': {'key': 'regionId', 'type': 'str'}, - 'tag_name': {'key': 'tagName', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(ImageRegion, self).__init__(**kwargs) - self.region_id = None - self.tag_name = None - self.created = None - self.tag_id = kwargs.get('tag_id', None) - self.left = kwargs.get('left', None) - self.top = kwargs.get('top', None) - self.width = kwargs.get('width', None) - self.height = kwargs.get('height', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_batch.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_batch.py deleted file mode 100644 index 57a66da6db1d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_batch.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionCreateBatch(Model): - """Batch of image region information to create. - - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] - """ - - _attribute_map = { - 'regions': {'key': 'regions', 'type': '[ImageRegionCreateEntry]'}, - } - - def __init__(self, **kwargs): - super(ImageRegionCreateBatch, self).__init__(**kwargs) - self.regions = kwargs.get('regions', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_batch_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_batch_py3.py deleted file mode 100644 index fa92c3452651..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_batch_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionCreateBatch(Model): - """Batch of image region information to create. - - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] - """ - - _attribute_map = { - 'regions': {'key': 'regions', 'type': '[ImageRegionCreateEntry]'}, - } - - def __init__(self, *, regions=None, **kwargs) -> None: - super(ImageRegionCreateBatch, self).__init__(**kwargs) - self.regions = regions diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_entry.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_entry.py deleted file mode 100644 index 0583409b327e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_entry.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionCreateEntry(Model): - """Entry associating a region to an image. - - All required parameters must be populated in order to send to Azure. - - :param image_id: Required. Id of the image. - :type image_id: str - :param tag_id: Required. Id of the tag associated with this region. - :type tag_id: str - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'image_id': {'required': True}, - 'tag_id': {'required': True}, - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'image_id': {'key': 'imageId', 'type': 'str'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(ImageRegionCreateEntry, self).__init__(**kwargs) - self.image_id = kwargs.get('image_id', None) - self.tag_id = kwargs.get('tag_id', None) - self.left = kwargs.get('left', None) - self.top = kwargs.get('top', None) - self.width = kwargs.get('width', None) - self.height = kwargs.get('height', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_entry_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_entry_py3.py deleted file mode 100644 index 4232b0bcf1ed..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_entry_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionCreateEntry(Model): - """Entry associating a region to an image. - - All required parameters must be populated in order to send to Azure. - - :param image_id: Required. Id of the image. - :type image_id: str - :param tag_id: Required. Id of the tag associated with this region. - :type tag_id: str - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'image_id': {'required': True}, - 'tag_id': {'required': True}, - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'image_id': {'key': 'imageId', 'type': 'str'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, *, image_id: str, tag_id: str, left: float, top: float, width: float, height: float, **kwargs) -> None: - super(ImageRegionCreateEntry, self).__init__(**kwargs) - self.image_id = image_id - self.tag_id = tag_id - self.left = left - self.top = top - self.width = width - self.height = height diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_result.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_result.py deleted file mode 100644 index 08dd0b09d754..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_result.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionCreateResult(Model): - """ImageRegionCreateResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar image_id: - :vartype image_id: str - :ivar region_id: - :vartype region_id: str - :ivar tag_name: - :vartype tag_name: str - :ivar created: - :vartype created: datetime - :param tag_id: Required. Id of the tag associated with this region. - :type tag_id: str - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'image_id': {'readonly': True}, - 'region_id': {'readonly': True}, - 'tag_name': {'readonly': True}, - 'created': {'readonly': True}, - 'tag_id': {'required': True}, - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'image_id': {'key': 'imageId', 'type': 'str'}, - 'region_id': {'key': 'regionId', 'type': 'str'}, - 'tag_name': {'key': 'tagName', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(ImageRegionCreateResult, self).__init__(**kwargs) - self.image_id = None - self.region_id = None - self.tag_name = None - self.created = None - self.tag_id = kwargs.get('tag_id', None) - self.left = kwargs.get('left', None) - self.top = kwargs.get('top', None) - self.width = kwargs.get('width', None) - self.height = kwargs.get('height', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_result_py3.py deleted file mode 100644 index 89fb4acd5ef6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_result_py3.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionCreateResult(Model): - """ImageRegionCreateResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar image_id: - :vartype image_id: str - :ivar region_id: - :vartype region_id: str - :ivar tag_name: - :vartype tag_name: str - :ivar created: - :vartype created: datetime - :param tag_id: Required. Id of the tag associated with this region. - :type tag_id: str - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'image_id': {'readonly': True}, - 'region_id': {'readonly': True}, - 'tag_name': {'readonly': True}, - 'created': {'readonly': True}, - 'tag_id': {'required': True}, - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'image_id': {'key': 'imageId', 'type': 'str'}, - 'region_id': {'key': 'regionId', 'type': 'str'}, - 'tag_name': {'key': 'tagName', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, *, tag_id: str, left: float, top: float, width: float, height: float, **kwargs) -> None: - super(ImageRegionCreateResult, self).__init__(**kwargs) - self.image_id = None - self.region_id = None - self.tag_name = None - self.created = None - self.tag_id = tag_id - self.left = left - self.top = top - self.width = width - self.height = height diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_summary.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_summary.py deleted file mode 100644 index f8b3b91f8100..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_summary.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionCreateSummary(Model): - """ImageRegionCreateSummary. - - :param created: - :type created: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateResult] - :param duplicated: - :type duplicated: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] - :param exceeded: - :type exceeded: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] - """ - - _attribute_map = { - 'created': {'key': 'created', 'type': '[ImageRegionCreateResult]'}, - 'duplicated': {'key': 'duplicated', 'type': '[ImageRegionCreateEntry]'}, - 'exceeded': {'key': 'exceeded', 'type': '[ImageRegionCreateEntry]'}, - } - - def __init__(self, **kwargs): - super(ImageRegionCreateSummary, self).__init__(**kwargs) - self.created = kwargs.get('created', None) - self.duplicated = kwargs.get('duplicated', None) - self.exceeded = kwargs.get('exceeded', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_summary_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_summary_py3.py deleted file mode 100644 index 64a6d7135440..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_create_summary_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionCreateSummary(Model): - """ImageRegionCreateSummary. - - :param created: - :type created: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateResult] - :param duplicated: - :type duplicated: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] - :param exceeded: - :type exceeded: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] - """ - - _attribute_map = { - 'created': {'key': 'created', 'type': '[ImageRegionCreateResult]'}, - 'duplicated': {'key': 'duplicated', 'type': '[ImageRegionCreateEntry]'}, - 'exceeded': {'key': 'exceeded', 'type': '[ImageRegionCreateEntry]'}, - } - - def __init__(self, *, created=None, duplicated=None, exceeded=None, **kwargs) -> None: - super(ImageRegionCreateSummary, self).__init__(**kwargs) - self.created = created - self.duplicated = duplicated - self.exceeded = exceeded diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_proposal.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_proposal.py deleted file mode 100644 index e39f82b310b2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_proposal.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionProposal(Model): - """ImageRegionProposal. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar project_id: - :vartype project_id: str - :ivar image_id: - :vartype image_id: str - :ivar proposals: - :vartype proposals: - list[~azure.cognitiveservices.vision.customvision.training.models.RegionProposal] - """ - - _validation = { - 'project_id': {'readonly': True}, - 'image_id': {'readonly': True}, - 'proposals': {'readonly': True}, - } - - _attribute_map = { - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'image_id': {'key': 'imageId', 'type': 'str'}, - 'proposals': {'key': 'proposals', 'type': '[RegionProposal]'}, - } - - def __init__(self, **kwargs): - super(ImageRegionProposal, self).__init__(**kwargs) - self.project_id = None - self.image_id = None - self.proposals = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_proposal_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_proposal_py3.py deleted file mode 100644 index aa63ca8063bb..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_proposal_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegionProposal(Model): - """ImageRegionProposal. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar project_id: - :vartype project_id: str - :ivar image_id: - :vartype image_id: str - :ivar proposals: - :vartype proposals: - list[~azure.cognitiveservices.vision.customvision.training.models.RegionProposal] - """ - - _validation = { - 'project_id': {'readonly': True}, - 'image_id': {'readonly': True}, - 'proposals': {'readonly': True}, - } - - _attribute_map = { - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'image_id': {'key': 'imageId', 'type': 'str'}, - 'proposals': {'key': 'proposals', 'type': '[RegionProposal]'}, - } - - def __init__(self, **kwargs) -> None: - super(ImageRegionProposal, self).__init__(**kwargs) - self.project_id = None - self.image_id = None - self.proposals = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_py3.py deleted file mode 100644 index 8a39e9d8bca8..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_region_py3.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageRegion(Model): - """ImageRegion. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar region_id: - :vartype region_id: str - :ivar tag_name: - :vartype tag_name: str - :ivar created: - :vartype created: datetime - :param tag_id: Required. Id of the tag associated with this region. - :type tag_id: str - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'region_id': {'readonly': True}, - 'tag_name': {'readonly': True}, - 'created': {'readonly': True}, - 'tag_id': {'required': True}, - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'region_id': {'key': 'regionId', 'type': 'str'}, - 'tag_name': {'key': 'tagName', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, *, tag_id: str, left: float, top: float, width: float, height: float, **kwargs) -> None: - super(ImageRegion, self).__init__(**kwargs) - self.region_id = None - self.tag_name = None - self.created = None - self.tag_id = tag_id - self.left = left - self.top = top - self.width = width - self.height = height diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag.py deleted file mode 100644 index ffd17a8ca593..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageTag(Model): - """ImageTag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag_id: - :vartype tag_id: str - :ivar tag_name: - :vartype tag_name: str - :ivar created: - :vartype created: datetime - """ - - _validation = { - 'tag_id': {'readonly': True}, - 'tag_name': {'readonly': True}, - 'created': {'readonly': True}, - } - - _attribute_map = { - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'tag_name': {'key': 'tagName', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ImageTag, self).__init__(**kwargs) - self.tag_id = None - self.tag_name = None - self.created = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_batch.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_batch.py deleted file mode 100644 index 562e6ae367dd..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_batch.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageTagCreateBatch(Model): - """Batch of image tags. - - :param tags: Image Tag entries to include in this batch. - :type tags: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '[ImageTagCreateEntry]'}, - } - - def __init__(self, **kwargs): - super(ImageTagCreateBatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_batch_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_batch_py3.py deleted file mode 100644 index aade1c4e49c0..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_batch_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageTagCreateBatch(Model): - """Batch of image tags. - - :param tags: Image Tag entries to include in this batch. - :type tags: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '[ImageTagCreateEntry]'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(ImageTagCreateBatch, self).__init__(**kwargs) - self.tags = tags diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_entry.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_entry.py deleted file mode 100644 index 82c5bb9ed7a6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_entry.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageTagCreateEntry(Model): - """Entry associating a tag to an image. - - :param image_id: Id of the image. - :type image_id: str - :param tag_id: Id of the tag. - :type tag_id: str - """ - - _attribute_map = { - 'image_id': {'key': 'imageId', 'type': 'str'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImageTagCreateEntry, self).__init__(**kwargs) - self.image_id = kwargs.get('image_id', None) - self.tag_id = kwargs.get('tag_id', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_entry_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_entry_py3.py deleted file mode 100644 index 3f8ed83c66f6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_entry_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageTagCreateEntry(Model): - """Entry associating a tag to an image. - - :param image_id: Id of the image. - :type image_id: str - :param tag_id: Id of the tag. - :type tag_id: str - """ - - _attribute_map = { - 'image_id': {'key': 'imageId', 'type': 'str'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - } - - def __init__(self, *, image_id: str=None, tag_id: str=None, **kwargs) -> None: - super(ImageTagCreateEntry, self).__init__(**kwargs) - self.image_id = image_id - self.tag_id = tag_id diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary.py deleted file mode 100644 index d5cdfda10fa4..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageTagCreateSummary(Model): - """ImageTagCreateSummary. - - :param created: - :type created: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] - :param duplicated: - :type duplicated: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] - :param exceeded: - :type exceeded: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] - """ - - _attribute_map = { - 'created': {'key': 'created', 'type': '[ImageTagCreateEntry]'}, - 'duplicated': {'key': 'duplicated', 'type': '[ImageTagCreateEntry]'}, - 'exceeded': {'key': 'exceeded', 'type': '[ImageTagCreateEntry]'}, - } - - def __init__(self, **kwargs): - super(ImageTagCreateSummary, self).__init__(**kwargs) - self.created = kwargs.get('created', None) - self.duplicated = kwargs.get('duplicated', None) - self.exceeded = kwargs.get('exceeded', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary_py3.py deleted file mode 100644 index 621c15f10edf..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_create_summary_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageTagCreateSummary(Model): - """ImageTagCreateSummary. - - :param created: - :type created: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] - :param duplicated: - :type duplicated: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] - :param exceeded: - :type exceeded: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] - """ - - _attribute_map = { - 'created': {'key': 'created', 'type': '[ImageTagCreateEntry]'}, - 'duplicated': {'key': 'duplicated', 'type': '[ImageTagCreateEntry]'}, - 'exceeded': {'key': 'exceeded', 'type': '[ImageTagCreateEntry]'}, - } - - def __init__(self, *, created=None, duplicated=None, exceeded=None, **kwargs) -> None: - super(ImageTagCreateSummary, self).__init__(**kwargs) - self.created = created - self.duplicated = duplicated - self.exceeded = exceeded diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_py3.py deleted file mode 100644 index 36eb32348f3b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_tag_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageTag(Model): - """ImageTag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag_id: - :vartype tag_id: str - :ivar tag_name: - :vartype tag_name: str - :ivar created: - :vartype created: datetime - """ - - _validation = { - 'tag_id': {'readonly': True}, - 'tag_name': {'readonly': True}, - 'created': {'readonly': True}, - } - - _attribute_map = { - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'tag_name': {'key': 'tagName', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs) -> None: - super(ImageTag, self).__init__(**kwargs) - self.tag_id = None - self.tag_name = None - self.created = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url.py deleted file mode 100644 index 1843cb88e722..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageUrl(Model): - """Image url. - - All required parameters must be populated in order to send to Azure. - - :param url: Required. Url of the image. - :type url: str - """ - - _validation = { - 'url': {'required': True}, - } - - _attribute_map = { - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImageUrl, self).__init__(**kwargs) - self.url = kwargs.get('url', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_batch.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_batch.py deleted file mode 100644 index c7b3b212df00..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_batch.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageUrlCreateBatch(Model): - """ImageUrlCreateBatch. - - :param images: - :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateEntry] - :param tag_ids: - :type tag_ids: list[str] - """ - - _attribute_map = { - 'images': {'key': 'images', 'type': '[ImageUrlCreateEntry]'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ImageUrlCreateBatch, self).__init__(**kwargs) - self.images = kwargs.get('images', None) - self.tag_ids = kwargs.get('tag_ids', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_batch_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_batch_py3.py deleted file mode 100644 index 5a298f7beec3..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_batch_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageUrlCreateBatch(Model): - """ImageUrlCreateBatch. - - :param images: - :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateEntry] - :param tag_ids: - :type tag_ids: list[str] - """ - - _attribute_map = { - 'images': {'key': 'images', 'type': '[ImageUrlCreateEntry]'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - } - - def __init__(self, *, images=None, tag_ids=None, **kwargs) -> None: - super(ImageUrlCreateBatch, self).__init__(**kwargs) - self.images = images - self.tag_ids = tag_ids diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_entry.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_entry.py deleted file mode 100644 index 10f6184ed4b5..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_entry.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageUrlCreateEntry(Model): - """ImageUrlCreateEntry. - - All required parameters must be populated in order to send to Azure. - - :param url: Required. Url of the image. - :type url: str - :param tag_ids: - :type tag_ids: list[str] - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.Region] - """ - - _validation = { - 'url': {'required': True}, - } - - _attribute_map = { - 'url': {'key': 'url', 'type': 'str'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - 'regions': {'key': 'regions', 'type': '[Region]'}, - } - - def __init__(self, **kwargs): - super(ImageUrlCreateEntry, self).__init__(**kwargs) - self.url = kwargs.get('url', None) - self.tag_ids = kwargs.get('tag_ids', None) - self.regions = kwargs.get('regions', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_entry_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_entry_py3.py deleted file mode 100644 index b0c5c72cebb2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_create_entry_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageUrlCreateEntry(Model): - """ImageUrlCreateEntry. - - All required parameters must be populated in order to send to Azure. - - :param url: Required. Url of the image. - :type url: str - :param tag_ids: - :type tag_ids: list[str] - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.Region] - """ - - _validation = { - 'url': {'required': True}, - } - - _attribute_map = { - 'url': {'key': 'url', 'type': 'str'}, - 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, - 'regions': {'key': 'regions', 'type': '[Region]'}, - } - - def __init__(self, *, url: str, tag_ids=None, regions=None, **kwargs) -> None: - super(ImageUrlCreateEntry, self).__init__(**kwargs) - self.url = url - self.tag_ids = tag_ids - self.regions = regions diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_py3.py deleted file mode 100644 index a219f5de8b08..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_url_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImageUrl(Model): - """Image url. - - All required parameters must be populated in order to send to Azure. - - :param url: Required. Url of the image. - :type url: str - """ - - _validation = { - 'url': {'required': True}, - } - - _attribute_map = { - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__(self, *, url: str, **kwargs) -> None: - super(ImageUrl, self).__init__(**kwargs) - self.url = url diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration.py deleted file mode 100644 index a6f6f81bcb3b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Iteration(Model): - """Iteration model to be sent over JSON. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Gets the id of the iteration. - :vartype id: str - :param name: Required. Gets or sets the name of the iteration. - :type name: str - :ivar status: Gets the current iteration status. - :vartype status: str - :ivar created: Gets the time this iteration was completed. - :vartype created: datetime - :ivar last_modified: Gets the time this iteration was last modified. - :vartype last_modified: datetime - :ivar trained_at: Gets the time this iteration was last modified. - :vartype trained_at: datetime - :ivar project_id: Gets the project id of the iteration. - :vartype project_id: str - :ivar exportable: Whether the iteration can be exported to another format - for download. - :vartype exportable: bool - :ivar exportable_to: A set of platforms this iteration can export to. - :vartype exportable_to: list[str] - :ivar domain_id: Get or sets a guid of the domain the iteration has been - trained on. - :vartype domain_id: str - :ivar classification_type: Gets the classification type of the project. - Possible values include: 'Multiclass', 'Multilabel' - :vartype classification_type: str or - ~azure.cognitiveservices.vision.customvision.training.models.Classifier - :ivar training_type: Gets the training type of the iteration. Possible - values include: 'Regular', 'Advanced' - :vartype training_type: str or - ~azure.cognitiveservices.vision.customvision.training.models.TrainingType - :ivar reserved_budget_in_hours: Gets the reserved advanced training budget - for the iteration. - :vartype reserved_budget_in_hours: int - :ivar publish_name: Name of the published model. - :vartype publish_name: str - :ivar original_publish_resource_id: Resource Provider Id this iteration - was originally published to. - :vartype original_publish_resource_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'required': True}, - 'status': {'readonly': True}, - 'created': {'readonly': True}, - 'last_modified': {'readonly': True}, - 'trained_at': {'readonly': True}, - 'project_id': {'readonly': True}, - 'exportable': {'readonly': True}, - 'exportable_to': {'readonly': True}, - 'domain_id': {'readonly': True}, - 'classification_type': {'readonly': True}, - 'training_type': {'readonly': True}, - 'reserved_budget_in_hours': {'readonly': True}, - 'publish_name': {'readonly': True}, - 'original_publish_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'trained_at': {'key': 'trainedAt', 'type': 'iso-8601'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'exportable': {'key': 'exportable', 'type': 'bool'}, - 'exportable_to': {'key': 'exportableTo', 'type': '[str]'}, - 'domain_id': {'key': 'domainId', 'type': 'str'}, - 'classification_type': {'key': 'classificationType', 'type': 'str'}, - 'training_type': {'key': 'trainingType', 'type': 'str'}, - 'reserved_budget_in_hours': {'key': 'reservedBudgetInHours', 'type': 'int'}, - 'publish_name': {'key': 'publishName', 'type': 'str'}, - 'original_publish_resource_id': {'key': 'originalPublishResourceId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Iteration, self).__init__(**kwargs) - self.id = None - self.name = kwargs.get('name', None) - self.status = None - self.created = None - self.last_modified = None - self.trained_at = None - self.project_id = None - self.exportable = None - self.exportable_to = None - self.domain_id = None - self.classification_type = None - self.training_type = None - self.reserved_budget_in_hours = None - self.publish_name = None - self.original_publish_resource_id = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_performance.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_performance.py deleted file mode 100644 index 40c0a075b44f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_performance.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class IterationPerformance(Model): - """Represents the detailed performance data for a trained iteration. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar per_tag_performance: Gets the per-tag performance details for this - iteration. - :vartype per_tag_performance: - list[~azure.cognitiveservices.vision.customvision.training.models.TagPerformance] - :ivar precision: Gets the precision. - :vartype precision: float - :ivar precision_std_deviation: Gets the standard deviation for the - precision. - :vartype precision_std_deviation: float - :ivar recall: Gets the recall. - :vartype recall: float - :ivar recall_std_deviation: Gets the standard deviation for the recall. - :vartype recall_std_deviation: float - :ivar average_precision: Gets the average precision when applicable. - :vartype average_precision: float - """ - - _validation = { - 'per_tag_performance': {'readonly': True}, - 'precision': {'readonly': True}, - 'precision_std_deviation': {'readonly': True}, - 'recall': {'readonly': True}, - 'recall_std_deviation': {'readonly': True}, - 'average_precision': {'readonly': True}, - } - - _attribute_map = { - 'per_tag_performance': {'key': 'perTagPerformance', 'type': '[TagPerformance]'}, - 'precision': {'key': 'precision', 'type': 'float'}, - 'precision_std_deviation': {'key': 'precisionStdDeviation', 'type': 'float'}, - 'recall': {'key': 'recall', 'type': 'float'}, - 'recall_std_deviation': {'key': 'recallStdDeviation', 'type': 'float'}, - 'average_precision': {'key': 'averagePrecision', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(IterationPerformance, self).__init__(**kwargs) - self.per_tag_performance = None - self.precision = None - self.precision_std_deviation = None - self.recall = None - self.recall_std_deviation = None - self.average_precision = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_performance_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_performance_py3.py deleted file mode 100644 index ab3e01f814b4..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_performance_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class IterationPerformance(Model): - """Represents the detailed performance data for a trained iteration. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar per_tag_performance: Gets the per-tag performance details for this - iteration. - :vartype per_tag_performance: - list[~azure.cognitiveservices.vision.customvision.training.models.TagPerformance] - :ivar precision: Gets the precision. - :vartype precision: float - :ivar precision_std_deviation: Gets the standard deviation for the - precision. - :vartype precision_std_deviation: float - :ivar recall: Gets the recall. - :vartype recall: float - :ivar recall_std_deviation: Gets the standard deviation for the recall. - :vartype recall_std_deviation: float - :ivar average_precision: Gets the average precision when applicable. - :vartype average_precision: float - """ - - _validation = { - 'per_tag_performance': {'readonly': True}, - 'precision': {'readonly': True}, - 'precision_std_deviation': {'readonly': True}, - 'recall': {'readonly': True}, - 'recall_std_deviation': {'readonly': True}, - 'average_precision': {'readonly': True}, - } - - _attribute_map = { - 'per_tag_performance': {'key': 'perTagPerformance', 'type': '[TagPerformance]'}, - 'precision': {'key': 'precision', 'type': 'float'}, - 'precision_std_deviation': {'key': 'precisionStdDeviation', 'type': 'float'}, - 'recall': {'key': 'recall', 'type': 'float'}, - 'recall_std_deviation': {'key': 'recallStdDeviation', 'type': 'float'}, - 'average_precision': {'key': 'averagePrecision', 'type': 'float'}, - } - - def __init__(self, **kwargs) -> None: - super(IterationPerformance, self).__init__(**kwargs) - self.per_tag_performance = None - self.precision = None - self.precision_std_deviation = None - self.recall = None - self.recall_std_deviation = None - self.average_precision = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_py3.py deleted file mode 100644 index e37421f780d2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/iteration_py3.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Iteration(Model): - """Iteration model to be sent over JSON. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Gets the id of the iteration. - :vartype id: str - :param name: Required. Gets or sets the name of the iteration. - :type name: str - :ivar status: Gets the current iteration status. - :vartype status: str - :ivar created: Gets the time this iteration was completed. - :vartype created: datetime - :ivar last_modified: Gets the time this iteration was last modified. - :vartype last_modified: datetime - :ivar trained_at: Gets the time this iteration was last modified. - :vartype trained_at: datetime - :ivar project_id: Gets the project id of the iteration. - :vartype project_id: str - :ivar exportable: Whether the iteration can be exported to another format - for download. - :vartype exportable: bool - :ivar exportable_to: A set of platforms this iteration can export to. - :vartype exportable_to: list[str] - :ivar domain_id: Get or sets a guid of the domain the iteration has been - trained on. - :vartype domain_id: str - :ivar classification_type: Gets the classification type of the project. - Possible values include: 'Multiclass', 'Multilabel' - :vartype classification_type: str or - ~azure.cognitiveservices.vision.customvision.training.models.Classifier - :ivar training_type: Gets the training type of the iteration. Possible - values include: 'Regular', 'Advanced' - :vartype training_type: str or - ~azure.cognitiveservices.vision.customvision.training.models.TrainingType - :ivar reserved_budget_in_hours: Gets the reserved advanced training budget - for the iteration. - :vartype reserved_budget_in_hours: int - :ivar publish_name: Name of the published model. - :vartype publish_name: str - :ivar original_publish_resource_id: Resource Provider Id this iteration - was originally published to. - :vartype original_publish_resource_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'required': True}, - 'status': {'readonly': True}, - 'created': {'readonly': True}, - 'last_modified': {'readonly': True}, - 'trained_at': {'readonly': True}, - 'project_id': {'readonly': True}, - 'exportable': {'readonly': True}, - 'exportable_to': {'readonly': True}, - 'domain_id': {'readonly': True}, - 'classification_type': {'readonly': True}, - 'training_type': {'readonly': True}, - 'reserved_budget_in_hours': {'readonly': True}, - 'publish_name': {'readonly': True}, - 'original_publish_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'trained_at': {'key': 'trainedAt', 'type': 'iso-8601'}, - 'project_id': {'key': 'projectId', 'type': 'str'}, - 'exportable': {'key': 'exportable', 'type': 'bool'}, - 'exportable_to': {'key': 'exportableTo', 'type': '[str]'}, - 'domain_id': {'key': 'domainId', 'type': 'str'}, - 'classification_type': {'key': 'classificationType', 'type': 'str'}, - 'training_type': {'key': 'trainingType', 'type': 'str'}, - 'reserved_budget_in_hours': {'key': 'reservedBudgetInHours', 'type': 'int'}, - 'publish_name': {'key': 'publishName', 'type': 'str'}, - 'original_publish_resource_id': {'key': 'originalPublishResourceId', 'type': 'str'}, - } - - def __init__(self, *, name: str, **kwargs) -> None: - super(Iteration, self).__init__(**kwargs) - self.id = None - self.name = name - self.status = None - self.created = None - self.last_modified = None - self.trained_at = None - self.project_id = None - self.exportable = None - self.exportable_to = None - self.domain_id = None - self.classification_type = None - self.training_type = None - self.reserved_budget_in_hours = None - self.publish_name = None - self.original_publish_resource_id = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction.py deleted file mode 100644 index 40e306a134fd..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Prediction(Model): - """Prediction result. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar probability: Probability of the tag. - :vartype probability: float - :ivar tag_id: Id of the predicted tag. - :vartype tag_id: str - :ivar tag_name: Name of the predicted tag. - :vartype tag_name: str - :ivar bounding_box: Bounding box of the prediction. - :vartype bounding_box: - ~azure.cognitiveservices.vision.customvision.training.models.BoundingBox - """ - - _validation = { - 'probability': {'readonly': True}, - 'tag_id': {'readonly': True}, - 'tag_name': {'readonly': True}, - 'bounding_box': {'readonly': True}, - } - - _attribute_map = { - 'probability': {'key': 'probability', 'type': 'float'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'tag_name': {'key': 'tagName', 'type': 'str'}, - 'bounding_box': {'key': 'boundingBox', 'type': 'BoundingBox'}, - } - - def __init__(self, **kwargs): - super(Prediction, self).__init__(**kwargs) - self.probability = None - self.tag_id = None - self.tag_name = None - self.bounding_box = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_py3.py deleted file mode 100644 index e3e68a1b26d0..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Prediction(Model): - """Prediction result. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar probability: Probability of the tag. - :vartype probability: float - :ivar tag_id: Id of the predicted tag. - :vartype tag_id: str - :ivar tag_name: Name of the predicted tag. - :vartype tag_name: str - :ivar bounding_box: Bounding box of the prediction. - :vartype bounding_box: - ~azure.cognitiveservices.vision.customvision.training.models.BoundingBox - """ - - _validation = { - 'probability': {'readonly': True}, - 'tag_id': {'readonly': True}, - 'tag_name': {'readonly': True}, - 'bounding_box': {'readonly': True}, - } - - _attribute_map = { - 'probability': {'key': 'probability', 'type': 'float'}, - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'tag_name': {'key': 'tagName', 'type': 'str'}, - 'bounding_box': {'key': 'boundingBox', 'type': 'BoundingBox'}, - } - - def __init__(self, **kwargs) -> None: - super(Prediction, self).__init__(**kwargs) - self.probability = None - self.tag_id = None - self.tag_name = None - self.bounding_box = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_result.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_result.py deleted file mode 100644 index 2a370043a7d2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_result.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PredictionQueryResult(Model): - """PredictionQueryResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar token: - :vartype token: - ~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken - :ivar results: - :vartype results: - list[~azure.cognitiveservices.vision.customvision.training.models.StoredImagePrediction] - """ - - _validation = { - 'token': {'readonly': True}, - 'results': {'readonly': True}, - } - - _attribute_map = { - 'token': {'key': 'token', 'type': 'PredictionQueryToken'}, - 'results': {'key': 'results', 'type': '[StoredImagePrediction]'}, - } - - def __init__(self, **kwargs): - super(PredictionQueryResult, self).__init__(**kwargs) - self.token = None - self.results = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_result_py3.py deleted file mode 100644 index cc142e583f00..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_result_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PredictionQueryResult(Model): - """PredictionQueryResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar token: - :vartype token: - ~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken - :ivar results: - :vartype results: - list[~azure.cognitiveservices.vision.customvision.training.models.StoredImagePrediction] - """ - - _validation = { - 'token': {'readonly': True}, - 'results': {'readonly': True}, - } - - _attribute_map = { - 'token': {'key': 'token', 'type': 'PredictionQueryToken'}, - 'results': {'key': 'results', 'type': '[StoredImagePrediction]'}, - } - - def __init__(self, **kwargs) -> None: - super(PredictionQueryResult, self).__init__(**kwargs) - self.token = None - self.results = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_tag.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_tag.py deleted file mode 100644 index bc1a5b38f4a7..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_tag.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PredictionQueryTag(Model): - """PredictionQueryTag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: - :vartype id: str - :ivar min_threshold: - :vartype min_threshold: float - :ivar max_threshold: - :vartype max_threshold: float - """ - - _validation = { - 'id': {'readonly': True}, - 'min_threshold': {'readonly': True}, - 'max_threshold': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'min_threshold': {'key': 'minThreshold', 'type': 'float'}, - 'max_threshold': {'key': 'maxThreshold', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(PredictionQueryTag, self).__init__(**kwargs) - self.id = None - self.min_threshold = None - self.max_threshold = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_tag_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_tag_py3.py deleted file mode 100644 index e54a47b940e6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_tag_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PredictionQueryTag(Model): - """PredictionQueryTag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: - :vartype id: str - :ivar min_threshold: - :vartype min_threshold: float - :ivar max_threshold: - :vartype max_threshold: float - """ - - _validation = { - 'id': {'readonly': True}, - 'min_threshold': {'readonly': True}, - 'max_threshold': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'min_threshold': {'key': 'minThreshold', 'type': 'float'}, - 'max_threshold': {'key': 'maxThreshold', 'type': 'float'}, - } - - def __init__(self, **kwargs) -> None: - super(PredictionQueryTag, self).__init__(**kwargs) - self.id = None - self.min_threshold = None - self.max_threshold = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_token.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_token.py deleted file mode 100644 index be38f8046f1a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_token.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PredictionQueryToken(Model): - """PredictionQueryToken. - - :param session: - :type session: str - :param continuation: - :type continuation: str - :param max_count: - :type max_count: int - :param order_by: Possible values include: 'Newest', 'Oldest', 'Suggested' - :type order_by: str or - ~azure.cognitiveservices.vision.customvision.training.models.OrderBy - :param tags: - :type tags: - list[~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryTag] - :param iteration_id: - :type iteration_id: str - :param start_time: - :type start_time: datetime - :param end_time: - :type end_time: datetime - :param application: - :type application: str - """ - - _attribute_map = { - 'session': {'key': 'session', 'type': 'str'}, - 'continuation': {'key': 'continuation', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'order_by': {'key': 'orderBy', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '[PredictionQueryTag]'}, - 'iteration_id': {'key': 'iterationId', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'application': {'key': 'application', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PredictionQueryToken, self).__init__(**kwargs) - self.session = kwargs.get('session', None) - self.continuation = kwargs.get('continuation', None) - self.max_count = kwargs.get('max_count', None) - self.order_by = kwargs.get('order_by', None) - self.tags = kwargs.get('tags', None) - self.iteration_id = kwargs.get('iteration_id', None) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - self.application = kwargs.get('application', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_token_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_token_py3.py deleted file mode 100644 index e7c911aa18cc..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/prediction_query_token_py3.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PredictionQueryToken(Model): - """PredictionQueryToken. - - :param session: - :type session: str - :param continuation: - :type continuation: str - :param max_count: - :type max_count: int - :param order_by: Possible values include: 'Newest', 'Oldest', 'Suggested' - :type order_by: str or - ~azure.cognitiveservices.vision.customvision.training.models.OrderBy - :param tags: - :type tags: - list[~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryTag] - :param iteration_id: - :type iteration_id: str - :param start_time: - :type start_time: datetime - :param end_time: - :type end_time: datetime - :param application: - :type application: str - """ - - _attribute_map = { - 'session': {'key': 'session', 'type': 'str'}, - 'continuation': {'key': 'continuation', 'type': 'str'}, - 'max_count': {'key': 'maxCount', 'type': 'int'}, - 'order_by': {'key': 'orderBy', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '[PredictionQueryTag]'}, - 'iteration_id': {'key': 'iterationId', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'application': {'key': 'application', 'type': 'str'}, - } - - def __init__(self, *, session: str=None, continuation: str=None, max_count: int=None, order_by=None, tags=None, iteration_id: str=None, start_time=None, end_time=None, application: str=None, **kwargs) -> None: - super(PredictionQueryToken, self).__init__(**kwargs) - self.session = session - self.continuation = continuation - self.max_count = max_count - self.order_by = order_by - self.tags = tags - self.iteration_id = iteration_id - self.start_time = start_time - self.end_time = end_time - self.application = application diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project.py deleted file mode 100644 index 47d2093a1219..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Project(Model): - """Represents a project. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Gets the project id. - :vartype id: str - :param name: Required. Gets or sets the name of the project. - :type name: str - :param description: Required. Gets or sets the description of the project. - :type description: str - :param settings: Required. Gets or sets the project settings. - :type settings: - ~azure.cognitiveservices.vision.customvision.training.models.ProjectSettings - :ivar created: Gets the date this project was created. - :vartype created: datetime - :ivar last_modified: Gets the date this project was last modified. - :vartype last_modified: datetime - :ivar thumbnail_uri: Gets the thumbnail url representing the image. - :vartype thumbnail_uri: str - :ivar dr_mode_enabled: Gets if the DR mode is on. - :vartype dr_mode_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'required': True}, - 'description': {'required': True}, - 'settings': {'required': True}, - 'created': {'readonly': True}, - 'last_modified': {'readonly': True}, - 'thumbnail_uri': {'readonly': True}, - 'dr_mode_enabled': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': 'ProjectSettings'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, - 'dr_mode_enabled': {'key': 'drModeEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(Project, self).__init__(**kwargs) - self.id = None - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.settings = kwargs.get('settings', None) - self.created = None - self.last_modified = None - self.thumbnail_uri = None - self.dr_mode_enabled = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_py3.py deleted file mode 100644 index ffa5cfb23422..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_py3.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Project(Model): - """Represents a project. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Gets the project id. - :vartype id: str - :param name: Required. Gets or sets the name of the project. - :type name: str - :param description: Required. Gets or sets the description of the project. - :type description: str - :param settings: Required. Gets or sets the project settings. - :type settings: - ~azure.cognitiveservices.vision.customvision.training.models.ProjectSettings - :ivar created: Gets the date this project was created. - :vartype created: datetime - :ivar last_modified: Gets the date this project was last modified. - :vartype last_modified: datetime - :ivar thumbnail_uri: Gets the thumbnail url representing the image. - :vartype thumbnail_uri: str - :ivar dr_mode_enabled: Gets if the DR mode is on. - :vartype dr_mode_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'required': True}, - 'description': {'required': True}, - 'settings': {'required': True}, - 'created': {'readonly': True}, - 'last_modified': {'readonly': True}, - 'thumbnail_uri': {'readonly': True}, - 'dr_mode_enabled': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'settings': {'key': 'settings', 'type': 'ProjectSettings'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, - 'dr_mode_enabled': {'key': 'drModeEnabled', 'type': 'bool'}, - } - - def __init__(self, *, name: str, description: str, settings, **kwargs) -> None: - super(Project, self).__init__(**kwargs) - self.id = None - self.name = name - self.description = description - self.settings = settings - self.created = None - self.last_modified = None - self.thumbnail_uri = None - self.dr_mode_enabled = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_settings.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_settings.py deleted file mode 100644 index 54277f94bd08..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_settings.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ProjectSettings(Model): - """Represents settings associated with a project. - - :param domain_id: Gets or sets the id of the Domain to use with this - project. - :type domain_id: str - :param classification_type: Gets or sets the classification type of the - project. Possible values include: 'Multiclass', 'Multilabel' - :type classification_type: str or - ~azure.cognitiveservices.vision.customvision.training.models.Classifier - :param target_export_platforms: A list of ExportPlatform that the trained - model should be able to support. - :type target_export_platforms: list[str] - """ - - _attribute_map = { - 'domain_id': {'key': 'domainId', 'type': 'str'}, - 'classification_type': {'key': 'classificationType', 'type': 'str'}, - 'target_export_platforms': {'key': 'targetExportPlatforms', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ProjectSettings, self).__init__(**kwargs) - self.domain_id = kwargs.get('domain_id', None) - self.classification_type = kwargs.get('classification_type', None) - self.target_export_platforms = kwargs.get('target_export_platforms', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_settings_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_settings_py3.py deleted file mode 100644 index 48a2adb1fd1e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/project_settings_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ProjectSettings(Model): - """Represents settings associated with a project. - - :param domain_id: Gets or sets the id of the Domain to use with this - project. - :type domain_id: str - :param classification_type: Gets or sets the classification type of the - project. Possible values include: 'Multiclass', 'Multilabel' - :type classification_type: str or - ~azure.cognitiveservices.vision.customvision.training.models.Classifier - :param target_export_platforms: A list of ExportPlatform that the trained - model should be able to support. - :type target_export_platforms: list[str] - """ - - _attribute_map = { - 'domain_id': {'key': 'domainId', 'type': 'str'}, - 'classification_type': {'key': 'classificationType', 'type': 'str'}, - 'target_export_platforms': {'key': 'targetExportPlatforms', 'type': '[str]'}, - } - - def __init__(self, *, domain_id: str=None, classification_type=None, target_export_platforms=None, **kwargs) -> None: - super(ProjectSettings, self).__init__(**kwargs) - self.domain_id = domain_id - self.classification_type = classification_type - self.target_export_platforms = target_export_platforms diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region.py deleted file mode 100644 index 82de079a6e4f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Region(Model): - """Region. - - All required parameters must be populated in order to send to Azure. - - :param tag_id: Required. Id of the tag associated with this region. - :type tag_id: str - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'tag_id': {'required': True}, - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(Region, self).__init__(**kwargs) - self.tag_id = kwargs.get('tag_id', None) - self.left = kwargs.get('left', None) - self.top = kwargs.get('top', None) - self.width = kwargs.get('width', None) - self.height = kwargs.get('height', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_proposal.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_proposal.py deleted file mode 100644 index b58858f97522..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_proposal.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class RegionProposal(Model): - """RegionProposal. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar confidence: - :vartype confidence: float - :ivar bounding_box: - :vartype bounding_box: - ~azure.cognitiveservices.vision.customvision.training.models.BoundingBox - """ - - _validation = { - 'confidence': {'readonly': True}, - 'bounding_box': {'readonly': True}, - } - - _attribute_map = { - 'confidence': {'key': 'confidence', 'type': 'float'}, - 'bounding_box': {'key': 'boundingBox', 'type': 'BoundingBox'}, - } - - def __init__(self, **kwargs): - super(RegionProposal, self).__init__(**kwargs) - self.confidence = None - self.bounding_box = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_proposal_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_proposal_py3.py deleted file mode 100644 index f4e238915368..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_proposal_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class RegionProposal(Model): - """RegionProposal. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar confidence: - :vartype confidence: float - :ivar bounding_box: - :vartype bounding_box: - ~azure.cognitiveservices.vision.customvision.training.models.BoundingBox - """ - - _validation = { - 'confidence': {'readonly': True}, - 'bounding_box': {'readonly': True}, - } - - _attribute_map = { - 'confidence': {'key': 'confidence', 'type': 'float'}, - 'bounding_box': {'key': 'boundingBox', 'type': 'BoundingBox'}, - } - - def __init__(self, **kwargs) -> None: - super(RegionProposal, self).__init__(**kwargs) - self.confidence = None - self.bounding_box = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_py3.py deleted file mode 100644 index 7d10cc583e6b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/region_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Region(Model): - """Region. - - All required parameters must be populated in order to send to Azure. - - :param tag_id: Required. Id of the tag associated with this region. - :type tag_id: str - :param left: Required. Coordinate of the left boundary. - :type left: float - :param top: Required. Coordinate of the top boundary. - :type top: float - :param width: Required. Width. - :type width: float - :param height: Required. Height. - :type height: float - """ - - _validation = { - 'tag_id': {'required': True}, - 'left': {'required': True}, - 'top': {'required': True}, - 'width': {'required': True}, - 'height': {'required': True}, - } - - _attribute_map = { - 'tag_id': {'key': 'tagId', 'type': 'str'}, - 'left': {'key': 'left', 'type': 'float'}, - 'top': {'key': 'top', 'type': 'float'}, - 'width': {'key': 'width', 'type': 'float'}, - 'height': {'key': 'height', 'type': 'float'}, - } - - def __init__(self, *, tag_id: str, left: float, top: float, width: float, height: float, **kwargs) -> None: - super(Region, self).__init__(**kwargs) - self.tag_id = tag_id - self.left = left - self.top = top - self.width = width - self.height = height diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/stored_image_prediction.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/stored_image_prediction.py deleted file mode 100644 index 5e9c3f4a2f18..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/stored_image_prediction.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StoredImagePrediction(Model): - """result of an image classification request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar resized_image_uri: The URI to the (resized) prediction image. - :vartype resized_image_uri: str - :ivar thumbnail_uri: The URI to the thumbnail of the original prediction - image. - :vartype thumbnail_uri: str - :ivar original_image_uri: The URI to the original prediction image. - :vartype original_image_uri: str - :ivar domain: Domain used for the prediction. - :vartype domain: str - :ivar id: Prediction Id. - :vartype id: str - :ivar project: Project Id. - :vartype project: str - :ivar iteration: Iteration Id. - :vartype iteration: str - :ivar created: Date this prediction was created. - :vartype created: datetime - :ivar predictions: List of predictions. - :vartype predictions: - list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] - """ - - _validation = { - 'resized_image_uri': {'readonly': True}, - 'thumbnail_uri': {'readonly': True}, - 'original_image_uri': {'readonly': True}, - 'domain': {'readonly': True}, - 'id': {'readonly': True}, - 'project': {'readonly': True}, - 'iteration': {'readonly': True}, - 'created': {'readonly': True}, - 'predictions': {'readonly': True}, - } - - _attribute_map = { - 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, - 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, - 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, - 'domain': {'key': 'domain', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'project': {'key': 'project', 'type': 'str'}, - 'iteration': {'key': 'iteration', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, - } - - def __init__(self, **kwargs): - super(StoredImagePrediction, self).__init__(**kwargs) - self.resized_image_uri = None - self.thumbnail_uri = None - self.original_image_uri = None - self.domain = None - self.id = None - self.project = None - self.iteration = None - self.created = None - self.predictions = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/stored_image_prediction_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/stored_image_prediction_py3.py deleted file mode 100644 index 453bdab006b2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/stored_image_prediction_py3.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StoredImagePrediction(Model): - """result of an image classification request. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar resized_image_uri: The URI to the (resized) prediction image. - :vartype resized_image_uri: str - :ivar thumbnail_uri: The URI to the thumbnail of the original prediction - image. - :vartype thumbnail_uri: str - :ivar original_image_uri: The URI to the original prediction image. - :vartype original_image_uri: str - :ivar domain: Domain used for the prediction. - :vartype domain: str - :ivar id: Prediction Id. - :vartype id: str - :ivar project: Project Id. - :vartype project: str - :ivar iteration: Iteration Id. - :vartype iteration: str - :ivar created: Date this prediction was created. - :vartype created: datetime - :ivar predictions: List of predictions. - :vartype predictions: - list[~azure.cognitiveservices.vision.customvision.training.models.Prediction] - """ - - _validation = { - 'resized_image_uri': {'readonly': True}, - 'thumbnail_uri': {'readonly': True}, - 'original_image_uri': {'readonly': True}, - 'domain': {'readonly': True}, - 'id': {'readonly': True}, - 'project': {'readonly': True}, - 'iteration': {'readonly': True}, - 'created': {'readonly': True}, - 'predictions': {'readonly': True}, - } - - _attribute_map = { - 'resized_image_uri': {'key': 'resizedImageUri', 'type': 'str'}, - 'thumbnail_uri': {'key': 'thumbnailUri', 'type': 'str'}, - 'original_image_uri': {'key': 'originalImageUri', 'type': 'str'}, - 'domain': {'key': 'domain', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'project': {'key': 'project', 'type': 'str'}, - 'iteration': {'key': 'iteration', 'type': 'str'}, - 'created': {'key': 'created', 'type': 'iso-8601'}, - 'predictions': {'key': 'predictions', 'type': '[Prediction]'}, - } - - def __init__(self, **kwargs) -> None: - super(StoredImagePrediction, self).__init__(**kwargs) - self.resized_image_uri = None - self.thumbnail_uri = None - self.original_image_uri = None - self.domain = None - self.id = None - self.project = None - self.iteration = None - self.created = None - self.predictions = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py deleted file mode 100644 index d9c89222ffec..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Tag(Model): - """Represents a Tag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Gets the Tag ID. - :vartype id: str - :param name: Required. Gets or sets the name of the tag. - :type name: str - :param description: Required. Gets or sets the description of the tag. - :type description: str - :param type: Required. Gets or sets the type of the tag. Possible values - include: 'Regular', 'Negative' - :type type: str or - ~azure.cognitiveservices.vision.customvision.training.models.TagType - :ivar image_count: Gets the number of images with this tag. - :vartype image_count: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'required': True}, - 'description': {'required': True}, - 'type': {'required': True}, - 'image_count': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'image_count': {'key': 'imageCount', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(Tag, self).__init__(**kwargs) - self.id = None - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.type = kwargs.get('type', None) - self.image_count = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_performance.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_performance.py deleted file mode 100644 index 21f548d6a943..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_performance.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TagPerformance(Model): - """Represents performance data for a particular tag in a trained iteration. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: - :vartype id: str - :ivar name: - :vartype name: str - :ivar precision: Gets the precision. - :vartype precision: float - :ivar precision_std_deviation: Gets the standard deviation for the - precision. - :vartype precision_std_deviation: float - :ivar recall: Gets the recall. - :vartype recall: float - :ivar recall_std_deviation: Gets the standard deviation for the recall. - :vartype recall_std_deviation: float - :ivar average_precision: Gets the average precision when applicable. - :vartype average_precision: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'precision': {'readonly': True}, - 'precision_std_deviation': {'readonly': True}, - 'recall': {'readonly': True}, - 'recall_std_deviation': {'readonly': True}, - 'average_precision': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'precision': {'key': 'precision', 'type': 'float'}, - 'precision_std_deviation': {'key': 'precisionStdDeviation', 'type': 'float'}, - 'recall': {'key': 'recall', 'type': 'float'}, - 'recall_std_deviation': {'key': 'recallStdDeviation', 'type': 'float'}, - 'average_precision': {'key': 'averagePrecision', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(TagPerformance, self).__init__(**kwargs) - self.id = None - self.name = None - self.precision = None - self.precision_std_deviation = None - self.recall = None - self.recall_std_deviation = None - self.average_precision = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_performance_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_performance_py3.py deleted file mode 100644 index d469c924d7d2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_performance_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TagPerformance(Model): - """Represents performance data for a particular tag in a trained iteration. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: - :vartype id: str - :ivar name: - :vartype name: str - :ivar precision: Gets the precision. - :vartype precision: float - :ivar precision_std_deviation: Gets the standard deviation for the - precision. - :vartype precision_std_deviation: float - :ivar recall: Gets the recall. - :vartype recall: float - :ivar recall_std_deviation: Gets the standard deviation for the recall. - :vartype recall_std_deviation: float - :ivar average_precision: Gets the average precision when applicable. - :vartype average_precision: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'precision': {'readonly': True}, - 'precision_std_deviation': {'readonly': True}, - 'recall': {'readonly': True}, - 'recall_std_deviation': {'readonly': True}, - 'average_precision': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'precision': {'key': 'precision', 'type': 'float'}, - 'precision_std_deviation': {'key': 'precisionStdDeviation', 'type': 'float'}, - 'recall': {'key': 'recall', 'type': 'float'}, - 'recall_std_deviation': {'key': 'recallStdDeviation', 'type': 'float'}, - 'average_precision': {'key': 'averagePrecision', 'type': 'float'}, - } - - def __init__(self, **kwargs) -> None: - super(TagPerformance, self).__init__(**kwargs) - self.id = None - self.name = None - self.precision = None - self.precision_std_deviation = None - self.recall = None - self.recall_std_deviation = None - self.average_precision = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_py3.py deleted file mode 100644 index 133e1746cd6a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Tag(Model): - """Represents a Tag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Gets the Tag ID. - :vartype id: str - :param name: Required. Gets or sets the name of the tag. - :type name: str - :param description: Required. Gets or sets the description of the tag. - :type description: str - :param type: Required. Gets or sets the type of the tag. Possible values - include: 'Regular', 'Negative' - :type type: str or - ~azure.cognitiveservices.vision.customvision.training.models.TagType - :ivar image_count: Gets the number of images with this tag. - :vartype image_count: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'required': True}, - 'description': {'required': True}, - 'type': {'required': True}, - 'image_count': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'image_count': {'key': 'imageCount', 'type': 'int'}, - } - - def __init__(self, *, name: str, description: str, type, **kwargs) -> None: - super(Tag, self).__init__(**kwargs) - self.id = None - self.name = name - self.description = description - self.type = type - self.image_count = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/operations/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/operations/__init__.py new file mode 100644 index 000000000000..f086ecd1b3a9 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._custom_vision_training_client_operations import CustomVisionTrainingClientOperationsMixin + +__all__ = [ + 'CustomVisionTrainingClientOperationsMixin', +] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/custom_vision_training_client.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/operations/_custom_vision_training_client_operations.py similarity index 87% rename from sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/custom_vision_training_client.py rename to sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/operations/_custom_vision_training_client_operations.py index fe3d73e1132e..b9c93e6cd9d8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/custom_vision_training_client.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/operations/_custom_vision_training_client_operations.py @@ -9,64 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Configuration, Serializer, Deserializer -from .version import VERSION from msrest.pipeline import ClientRawResponse -from . import models +from .. import models -class CustomVisionTrainingClientConfiguration(Configuration): - """Configuration for CustomVisionTrainingClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param api_key: API key. - :type api_key: str - :param endpoint: Supported Cognitive Services endpoints. - :type endpoint: str - """ - - def __init__( - self, api_key, endpoint): - - if api_key is None: - raise ValueError("Parameter 'api_key' must not be None.") - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - base_url = '{Endpoint}/customvision/v3.0/training' - - super(CustomVisionTrainingClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-cognitiveservices-vision-customvision/{}'.format(VERSION)) - - self.api_key = api_key - self.endpoint = endpoint - - -class CustomVisionTrainingClient(SDKClient): - """CustomVisionTrainingClient - - :ivar config: Configuration for client. - :vartype config: CustomVisionTrainingClientConfiguration - - :param api_key: API key. - :type api_key: str - :param endpoint: Supported Cognitive Services endpoints. - :type endpoint: str - """ - - def __init__( - self, api_key, endpoint): - - self.config = CustomVisionTrainingClientConfiguration(api_key, endpoint) - super(CustomVisionTrainingClient, self).__init__(None, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '3.0' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - +class CustomVisionTrainingClientOperationsMixin(object): def get_domains( self, custom_headers=None, raw=False, **operation_config): @@ -99,7 +46,6 @@ def get_domains( header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -109,7 +55,6 @@ def get_domains( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('[Domain]', response) @@ -154,7 +99,6 @@ def get_domain( header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -164,7 +108,6 @@ def get_domain( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('Domain', response) @@ -175,53 +118,37 @@ def get_domain( return deserialized get_domain.metadata = {'url': '/domains/{domainId}'} - def get_tagged_image_count( - self, project_id, iteration_id=None, tag_ids=None, custom_headers=None, raw=False, **operation_config): - """Gets the number of images tagged with the provided {tagIds}. - - 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. + def get_projects( + self, custom_headers=None, raw=False, **operation_config): + """Get your projects. - :param project_id: The project id. - :type project_id: str - :param iteration_id: The iteration id. Defaults to workspace. - :type iteration_id: str - :param tag_ids: A list of tags ids to filter the images to count. - Defaults to all tags when null. - :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: int or ClientRawResponse if raw=true - :rtype: int or ~msrest.pipeline.ClientRawResponse + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.vision.customvision.training.models.Project] + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_tagged_image_count.metadata['url'] + url = self.get_projects.metadata['url'] path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str') + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - if iteration_id is not None: - query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') - if tag_ids is not None: - query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -231,103 +158,108 @@ def get_tagged_image_count( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('int', response) + deserialized = self._deserialize('[Project]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_tagged_image_count.metadata = {'url': '/projects/{projectId}/images/tagged/count'} - - def get_untagged_image_count( - self, project_id, iteration_id=None, custom_headers=None, raw=False, **operation_config): - """Gets the number of untagged images. + get_projects.metadata = {'url': '/projects'} - This API returns the images which have no tags for a given project and - optionally an iteration. If no iteration is specified the - current workspace is used. + def create_project( + self, name, description=None, domain_id=None, classification_type=None, target_export_platforms=None, custom_headers=None, raw=False, **operation_config): + """Create a project. - :param project_id: The project id. - :type project_id: str - :param iteration_id: The iteration id. Defaults to workspace. - :type iteration_id: str + :param name: Name of the project. + :type name: str + :param description: The description of the project. + :type description: str + :param domain_id: The id of the domain to use for this project. + Defaults to General. + :type domain_id: str + :param classification_type: The type of classifier to create for this + project. Possible values include: 'Multiclass', 'Multilabel' + :type classification_type: str + :param target_export_platforms: List of platforms the trained model is + intending exporting to. + :type target_export_platforms: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: int or ClientRawResponse if raw=true - :rtype: int or ~msrest.pipeline.ClientRawResponse + :return: Project or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.vision.customvision.training.models.Project + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_untagged_image_count.metadata['url'] + url = self.create_project.metadata['url'] path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str') + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - if iteration_id is not None: - query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') + query_parameters['name'] = self._serialize.query("name", name, 'str') + if description is not None: + query_parameters['description'] = self._serialize.query("description", description, 'str') + if domain_id is not None: + query_parameters['domainId'] = self._serialize.query("domain_id", domain_id, 'str') + if classification_type is not None: + query_parameters['classificationType'] = self._serialize.query("classification_type", classification_type, 'str') + if target_export_platforms is not None: + query_parameters['targetExportPlatforms'] = self._serialize.query("target_export_platforms", target_export_platforms, '[str]', div=',') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('int', response) + deserialized = self._deserialize('Project', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_untagged_image_count.metadata = {'url': '/projects/{projectId}/images/untagged/count'} + create_project.metadata = {'url': '/projects'} - def create_image_tags( - self, project_id, tags=None, custom_headers=None, raw=False, **operation_config): - """Associate a set of images with a set of tags. + def get_project( + self, project_id, custom_headers=None, raw=False, **operation_config): + """Get a specific project. - :param project_id: The project id. + :param project_id: The id of the project to get. :type project_id: str - :param tags: Image Tag entries to include in this batch. - :type tags: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ImageTagCreateSummary or ClientRawResponse if raw=true + :return: Project or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateSummary + ~azure.cognitiveservices.vision.customvision.training.models.Project or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ - batch = models.ImageTagCreateBatch(tags=tags) - # Construct URL - url = self.create_image_tags.metadata['url'] + url = self.get_project.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -340,44 +272,33 @@ def create_image_tags( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') - - # Construct body - body_content = self._serialize.body(batch, 'ImageTagCreateBatch') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ImageTagCreateSummary', response) + deserialized = self._deserialize('Project', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_image_tags.metadata = {'url': '/projects/{projectId}/images/tags'} + get_project.metadata = {'url': '/projects/{projectId}'} - def delete_image_tags( - self, project_id, image_ids, tag_ids, custom_headers=None, raw=False, **operation_config): - """Remove a set of tags from a set of images. + def delete_project( + self, project_id, custom_headers=None, raw=False, **operation_config): + """Delete a specific project. :param project_id: The project id. :type project_id: str - :param image_ids: Image ids. Limited to 64 images. - :type image_ids: list[str] - :param tag_ids: Tags to be deleted from the specified images. Limited - to 20 tags. - :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -389,7 +310,7 @@ def delete_image_tags( :class:`CustomVisionErrorException` """ # Construct URL - url = self.delete_image_tags.metadata['url'] + url = self.delete_project.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -398,14 +319,11 @@ def delete_image_tags( # Construct parameters query_parameters = {} - query_parameters['imageIds'] = self._serialize.query("image_ids", image_ids, '[str]', div=',', max_items=64, min_items=0) - query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',', max_items=20, min_items=0) # Construct headers header_parameters = {} if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) @@ -417,37 +335,31 @@ def delete_image_tags( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_image_tags.metadata = {'url': '/projects/{projectId}/images/tags'} - - def create_image_regions( - self, project_id, regions=None, custom_headers=None, raw=False, **operation_config): - """Create a set of image regions. + delete_project.metadata = {'url': '/projects/{projectId}'} - This API accepts a batch of image regions, and optionally tags, to - update existing images with region information. - There is a limit of 64 entries in the batch. + def update_project( + self, project_id, updated_project, custom_headers=None, raw=False, **operation_config): + """Update a specific project. - :param project_id: The project id. + :param project_id: The id of the project to update. :type project_id: str - :param regions: - :type regions: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] + :param updated_project: The updated project model. + :type updated_project: + ~azure.cognitiveservices.vision.customvision.training.models.Project :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ImageRegionCreateSummary or ClientRawResponse if raw=true + :return: Project or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateSummary + ~azure.cognitiveservices.vision.customvision.training.models.Project or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ - batch = models.ImageRegionCreateBatch(regions=regions) - # Construct URL - url = self.create_image_regions.metadata['url'] + url = self.update_project.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -463,50 +375,48 @@ def create_image_regions( header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct body - body_content = self._serialize.body(batch, 'ImageRegionCreateBatch') + body_content = self._serialize.body(updated_project, 'Project') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ImageRegionCreateSummary', response) + deserialized = self._deserialize('Project', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_image_regions.metadata = {'url': '/projects/{projectId}/images/regions'} + update_project.metadata = {'url': '/projects/{projectId}'} - def delete_image_regions( - self, project_id, region_ids, custom_headers=None, raw=False, **operation_config): - """Delete a set of image regions. + def export_project( + self, project_id, custom_headers=None, raw=False, **operation_config): + """Exports a project. - :param project_id: The project id. + :param project_id: The project id of the project to export. :type project_id: str - :param region_ids: Regions to delete. Limited to 64. - :type region_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: ProjectExport or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.vision.customvision.training.models.ProjectExport + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.delete_image_regions.metadata['url'] + url = self.export_project.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -515,69 +425,61 @@ def delete_image_regions( # Construct parameters query_parameters = {} - query_parameters['regionIds'] = self._serialize.query("region_ids", region_ids, '[str]', div=',', max_items=64, min_items=0) # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProjectExport', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_image_regions.metadata = {'url': '/projects/{projectId}/images/regions'} - def get_tagged_images( - self, project_id, iteration_id=None, tag_ids=None, order_by=None, take=50, skip=0, custom_headers=None, raw=False, **operation_config): - """Get tagged images for a given project iteration. + return deserialized + export_project.metadata = {'url': '/projects/{projectId}/export'} - 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. + def create_images_from_data( + self, project_id, image_data, tag_ids=None, custom_headers=None, raw=False, **operation_config): + """Add the provided images to the set of training images. + + This API accepts body content as multipart/form-data and + application/octet-stream. When using multipart + multiple image files can be sent at once, with a maximum of 64 files. :param project_id: The project id. :type project_id: str - :param iteration_id: The iteration id. Defaults to workspace. - :type iteration_id: str - :param tag_ids: A list of tags ids to filter the images. Defaults to - all tagged images when null. Limited to 20. + :param image_data: Binary image data. Supported formats are JPEG, GIF, + PNG, and BMP. Supports images up to 6MB. + :type image_data: Generator + :param tag_ids: The tags ids with which to tag each image. Limited to + 20. :type tag_ids: list[str] - :param order_by: The ordering. Defaults to newest. Possible values - include: 'Newest', 'Oldest' - :type order_by: str - :param take: Maximum number of images to return. Defaults to 50, - limited to 256. - :type take: int - :param skip: Number of images to skip before beginning the image - batch. Defaults to 0. - :type skip: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true + :return: ImageCreateSummary or ClientRawResponse if raw=true :rtype: - list[~azure.cognitiveservices.vision.customvision.training.models.Image] + ~azure.cognitiveservices.vision.customvision.training.models.ImageCreateSummary or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_tagged_images.metadata['url'] + url = self.create_images_from_data.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -586,79 +488,68 @@ def get_tagged_images( # Construct parameters query_parameters = {} - if iteration_id is not None: - query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') if tag_ids is not None: query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',', max_items=20, min_items=0) - if order_by is not None: - query_parameters['orderBy'] = self._serialize.query("order_by", order_by, 'str') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=256, minimum=0) - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'multipart/form-data' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') + + # Construct form data + form_data_content = { + 'imageData': image_data, + } # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, form_content=form_data_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[Image]', response) + deserialized = self._deserialize('ImageCreateSummary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_tagged_images.metadata = {'url': '/projects/{projectId}/images/tagged'} - - def get_untagged_images( - self, project_id, iteration_id=None, order_by=None, take=50, skip=0, custom_headers=None, raw=False, **operation_config): - """Get untagged images for a given project iteration. + create_images_from_data.metadata = {'url': '/projects/{projectId}/images'} - 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. + def delete_images( + self, project_id, image_ids=None, all_images=None, all_iterations=None, custom_headers=None, raw=False, **operation_config): + """Delete images from the set of training images. :param project_id: The project id. :type project_id: str - :param iteration_id: The iteration id. Defaults to workspace. - :type iteration_id: str - :param order_by: The ordering. Defaults to newest. Possible values - include: 'Newest', 'Oldest' - :type order_by: str - :param take: Maximum number of images to return. Defaults to 50, - limited to 256. - :type take: int - :param skip: Number of images to skip before beginning the image - batch. Defaults to 0. - :type skip: int + :param image_ids: Ids of the images to be deleted. Limited to 256 + images per batch. + :type image_ids: list[str] + :param all_images: Flag to specify delete all images, specify this + flag or a list of images. Using this flag will return a 202 response + to indicate the images are being deleted. + :type all_images: bool + :param all_iterations: Removes these images from all iterations, not + just the current workspace. Using this flag will return a 202 response + to indicate the images are being deleted. + :type all_iterations: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.vision.customvision.training.models.Image] - or ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_untagged_images.metadata['url'] + url = self.delete_images.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -667,123 +558,103 @@ def get_untagged_images( # Construct parameters query_parameters = {} - if iteration_id is not None: - query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') - if order_by is not None: - query_parameters['orderBy'] = self._serialize.query("order_by", order_by, 'str') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=256, minimum=0) - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') + if image_ids is not None: + query_parameters['imageIds'] = self._serialize.query("image_ids", image_ids, '[str]', div=',', max_items=256, min_items=0) + if all_images is not None: + query_parameters['allImages'] = self._serialize.query("all_images", all_images, 'bool') + if all_iterations is not None: + query_parameters['allIterations'] = self._serialize.query("all_iterations", all_iterations, 'bool') # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [202, 204]: raise models.CustomVisionErrorException(self._deserialize, response) - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Image]', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_images.metadata = {'url': '/projects/{projectId}/images'} - return deserialized - get_untagged_images.metadata = {'url': '/projects/{projectId}/images/untagged'} - - def get_images_by_ids( - self, project_id, image_ids=None, iteration_id=None, custom_headers=None, raw=False, **operation_config): - """Get images by id for a given project iteration. + def get_image_region_proposals( + self, project_id, image_id, custom_headers=None, raw=False, **operation_config): + """Get region proposals for an image. Returns empty array if no proposals + are found. - This API will return a set of Images for the specified tags and - optionally iteration. If no iteration is specified the - current workspace is used. + This API will get region proposals for an image along with confidences + for the region. It returns an empty array if no proposals are found. :param project_id: The project id. :type project_id: str - :param image_ids: The list of image ids to retrieve. Limited to 256. - :type image_ids: list[str] - :param iteration_id: The iteration id. Defaults to workspace. - :type iteration_id: str + :param image_id: The image id. + :type image_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true + :return: ImageRegionProposal or ClientRawResponse if raw=true :rtype: - list[~azure.cognitiveservices.vision.customvision.training.models.Image] + ~azure.cognitiveservices.vision.customvision.training.models.ImageRegionProposal or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_images_by_ids.metadata['url'] + url = self.get_image_region_proposals.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'imageId': self._serialize.url("image_id", image_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - if image_ids is not None: - query_parameters['imageIds'] = self._serialize.query("image_ids", image_ids, '[str]', div=',', max_items=256, min_items=0) - if iteration_id is not None: - query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[Image]', response) + deserialized = self._deserialize('ImageRegionProposal', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_images_by_ids.metadata = {'url': '/projects/{projectId}/images/id'} + get_image_region_proposals.metadata = {'url': '/projects/{projectId}/images/{imageId}/regionproposals'} - def create_images_from_data( - self, project_id, image_data, tag_ids=None, custom_headers=None, raw=False, **operation_config): - """Add the provided images to the set of training images. + def create_images_from_files( + self, project_id, images=None, tag_ids=None, custom_headers=None, raw=False, **operation_config): + """Add the provided batch of images to the set of training images. - This API accepts body content as multipart/form-data and - application/octet-stream. When using multipart - multiple image files can be sent at once, with a maximum of 64 files. + This API accepts a batch of files, and optionally tags, to create + images. There is a limit of 64 images and 20 tags. :param project_id: The project id. :type project_id: str - :param image_data: Binary image data. Supported formats are JPEG, GIF, - PNG, and BMP. Supports images up to 6MB. - :type image_data: Generator - :param tag_ids: The tags ids with which to tag each image. Limited to - 20. + :param images: + :type images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateEntry] + :param tag_ids: :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -797,8 +668,10 @@ def create_images_from_data( :raises: :class:`CustomVisionErrorException` """ + batch = models.ImageFileCreateBatch(images=images, tag_ids=tag_ids) + # Construct URL - url = self.create_images_from_data.metadata['url'] + url = self.create_images_from_files.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -807,31 +680,25 @@ def create_images_from_data( # Construct parameters query_parameters = {} - if tag_ids is not None: - query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',', max_items=20, min_items=0) # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'multipart/form-data' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') - # Construct form data - form_data_content = { - 'imageData': image_data, - } + # Construct body + body_content = self._serialize.body(batch, 'ImageFileCreateBatch') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, form_content=form_data_content) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ImageCreateSummary', response) @@ -840,29 +707,36 @@ def create_images_from_data( return client_raw_response return deserialized - create_images_from_data.metadata = {'url': '/projects/{projectId}/images'} + create_images_from_files.metadata = {'url': '/projects/{projectId}/images/files'} - def delete_images( - self, project_id, image_ids, custom_headers=None, raw=False, **operation_config): - """Delete images from the set of training images. + def get_images_by_ids( + self, project_id, image_ids=None, iteration_id=None, custom_headers=None, raw=False, **operation_config): + """Get images by id for a given project iteration. + + This API will return a set of Images for the specified tags and + optionally iteration. If no iteration is specified the + current workspace is used. :param project_id: The project id. :type project_id: str - :param image_ids: Ids of the images to be deleted. Limited to 256 - images per batch. + :param image_ids: The list of image ids to retrieve. Limited to 256. :type image_ids: list[str] + :param iteration_id: The iteration id. Defaults to workspace. + :type iteration_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.cognitiveservices.vision.customvision.training.models.Image] + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.delete_images.metadata['url'] + url = self.get_images_by_ids.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -871,38 +745,47 @@ def delete_images( # Construct parameters query_parameters = {} - query_parameters['imageIds'] = self._serialize.query("image_ids", image_ids, '[str]', div=',', max_items=256, min_items=0) + if image_ids is not None: + query_parameters['imageIds'] = self._serialize.query("image_ids", image_ids, '[str]', div=',', max_items=256, min_items=0) + if iteration_id is not None: + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[Image]', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_images.metadata = {'url': '/projects/{projectId}/images'} - def create_images_from_files( + return deserialized + get_images_by_ids.metadata = {'url': '/projects/{projectId}/images/id'} + + def create_images_from_predictions( self, project_id, images=None, tag_ids=None, custom_headers=None, raw=False, **operation_config): - """Add the provided batch of images to the set of training images. + """Add the specified predicted images to the set of training images. - This API accepts a batch of files, and optionally tags, to create - images. There is a limit of 64 images and 20 tags. + This API creates a batch of images from predicted images specified. + There is a limit of 64 images and 20 tags. :param project_id: The project id. :type project_id: str :param images: :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageFileCreateEntry] + list[~azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateEntry] :param tag_ids: :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request @@ -917,10 +800,10 @@ def create_images_from_files( :raises: :class:`CustomVisionErrorException` """ - batch = models.ImageFileCreateBatch(images=images, tag_ids=tag_ids) + batch = models.ImageIdCreateBatch(images=images, tag_ids=tag_ids) # Construct URL - url = self.create_images_from_files.metadata['url'] + url = self.create_images_from_predictions.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -936,10 +819,9 @@ def create_images_from_files( header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct body - body_content = self._serialize.body(batch, 'ImageFileCreateBatch') + body_content = self._serialize.body(batch, 'ImageIdCreateBatch') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -949,7 +831,6 @@ def create_images_from_files( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ImageCreateSummary', response) @@ -958,38 +839,37 @@ def create_images_from_files( return client_raw_response return deserialized - create_images_from_files.metadata = {'url': '/projects/{projectId}/images/files'} + create_images_from_predictions.metadata = {'url': '/projects/{projectId}/images/predictions'} - def create_images_from_urls( - self, project_id, images=None, tag_ids=None, custom_headers=None, raw=False, **operation_config): - """Add the provided images urls to the set of training images. + def create_image_regions( + self, project_id, regions=None, custom_headers=None, raw=False, **operation_config): + """Create a set of image regions. - This API accepts a batch of urls, and optionally tags, to create - images. There is a limit of 64 images and 20 tags. + This API accepts a batch of image regions, and optionally tags, to + update existing images with region information. + There is a limit of 64 entries in the batch. :param project_id: The project id. :type project_id: str - :param images: - :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateEntry] - :param tag_ids: - :type tag_ids: list[str] + :param regions: + :type regions: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateEntry] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ImageCreateSummary or ClientRawResponse if raw=true + :return: ImageRegionCreateSummary or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.ImageCreateSummary + ~azure.cognitiveservices.vision.customvision.training.models.ImageRegionCreateSummary or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ - batch = models.ImageUrlCreateBatch(images=images, tag_ids=tag_ids) + batch = models.ImageRegionCreateBatch(regions=regions) # Construct URL - url = self.create_images_from_urls.metadata['url'] + url = self.create_image_regions.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -1005,10 +885,9 @@ def create_images_from_urls( header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct body - body_content = self._serialize.body(batch, 'ImageUrlCreateBatch') + body_content = self._serialize.body(batch, 'ImageRegionCreateBatch') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -1018,47 +897,36 @@ def create_images_from_urls( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ImageCreateSummary', response) + deserialized = self._deserialize('ImageRegionCreateSummary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_images_from_urls.metadata = {'url': '/projects/{projectId}/images/urls'} - - def create_images_from_predictions( - self, project_id, images=None, tag_ids=None, custom_headers=None, raw=False, **operation_config): - """Add the specified predicted images to the set of training images. + create_image_regions.metadata = {'url': '/projects/{projectId}/images/regions'} - This API creates a batch of images from predicted images specified. - There is a limit of 64 images and 20 tags. + def delete_image_regions( + self, project_id, region_ids, custom_headers=None, raw=False, **operation_config): + """Delete a set of image regions. :param project_id: The project id. :type project_id: str - :param images: - :type images: - list[~azure.cognitiveservices.vision.customvision.training.models.ImageIdCreateEntry] - :param tag_ids: - :type tag_ids: list[str] + :param region_ids: Regions to delete. Limited to 64. + :type region_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ImageCreateSummary or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.ImageCreateSummary - or ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ - batch = models.ImageIdCreateBatch(images=images, tag_ids=tag_ids) - # Construct URL - url = self.create_images_from_predictions.metadata['url'] + url = self.delete_image_regions.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -1067,120 +935,126 @@ def create_images_from_predictions( # Construct parameters query_parameters = {} + query_parameters['regionIds'] = self._serialize.query("region_ids", region_ids, '[str]', div=',', max_items=64, min_items=0) # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') - - # Construct body - body_content = self._serialize.body(batch, 'ImageIdCreateBatch') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [204]: raise models.CustomVisionErrorException(self._deserialize, response) - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ImageCreateSummary', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_image_regions.metadata = {'url': '/projects/{projectId}/images/regions'} - return deserialized - create_images_from_predictions.metadata = {'url': '/projects/{projectId}/images/predictions'} - - def get_image_region_proposals( - self, project_id, image_id, custom_headers=None, raw=False, **operation_config): - """Get region proposals for an image. Returns empty array if no proposals - are found. + def query_suggested_images( + self, project_id, iteration_id, query, custom_headers=None, raw=False, **operation_config): + """Get untagged images whose suggested tags match given tags. Returns + empty array if no images are found. - This API will get region proposals for an image along with confidences - for the region. It returns an empty array if no proposals are found. + This API will fetch untagged images filtered by suggested tags Ids. It + returns an empty array if no images are found. :param project_id: The project id. :type project_id: str - :param image_id: The image id. - :type image_id: str + :param iteration_id: IterationId to use for the suggested tags and + regions. + :type iteration_id: str + :param query: Contains properties we need to query suggested images. + :type query: + ~azure.cognitiveservices.vision.customvision.training.models.SuggestedTagAndRegionQueryToken :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ImageRegionProposal or ClientRawResponse if raw=true + :return: SuggestedTagAndRegionQuery or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.ImageRegionProposal + ~azure.cognitiveservices.vision.customvision.training.models.SuggestedTagAndRegionQuery or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_image_region_proposals.metadata['url'] + url = self.query_suggested_images.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'imageId': self._serialize.url("image_id", image_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') + + # Construct body + body_content = self._serialize.body(query, 'SuggestedTagAndRegionQueryToken') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ImageRegionProposal', response) + deserialized = self._deserialize('SuggestedTagAndRegionQuery', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_image_region_proposals.metadata = {'url': '/projects/{projectId}/images/{imageId}/regionproposals'} + query_suggested_images.metadata = {'url': '/projects/{projectId}/images/suggested'} - def delete_prediction( - self, project_id, ids, custom_headers=None, raw=False, **operation_config): - """Delete a set of predicted images and their associated prediction - results. + def query_suggested_image_count( + self, project_id, iteration_id, tag_ids=None, threshold=None, custom_headers=None, raw=False, **operation_config): + """Get count of images whose suggested tags match given tags and their + probabilities are greater than or equal to the given threshold. Returns + count as 0 if none found. + + This API takes in tagIds to get count of untagged images per suggested + tags for a given threshold. :param project_id: The project id. :type project_id: str - :param ids: The prediction ids. Limited to 64. - :type ids: list[str] + :param iteration_id: IterationId to use for the suggested tags and + regions. + :type iteration_id: str + :param tag_ids: Existing TagIds in project to get suggested tags count + for. + :type tag_ids: list[str] + :param threshold: Confidence threshold to filter suggested tags on. + :type threshold: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: dict or ClientRawResponse if raw=true + :rtype: dict[str, int] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ + query = models.TagFilter(tag_ids=tag_ids, threshold=threshold) + # Construct URL - url = self.delete_prediction.metadata['url'] + url = self.query_suggested_image_count.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -1189,54 +1063,79 @@ def delete_prediction( # Construct parameters query_parameters = {} - query_parameters['ids'] = self._serialize.query("ids", ids, '[str]', div=',', max_items=64, min_items=0) + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') + + # Construct body + body_content = self._serialize.body(query, 'TagFilter') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('{int}', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete_prediction.metadata = {'url': '/projects/{projectId}/predictions'} - def quick_test_image_url( - self, project_id, url, iteration_id=None, custom_headers=None, raw=False, **operation_config): - """Quick test an image url. + return deserialized + query_suggested_image_count.metadata = {'url': '/projects/{projectId}/images/suggested/count'} - :param project_id: The project to evaluate against. + def get_tagged_images( + self, project_id, iteration_id=None, tag_ids=None, order_by=None, take=50, skip=0, custom_headers=None, raw=False, **operation_config): + """Get tagged images for a given project iteration. + + 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. + + :param project_id: The project id. :type project_id: str - :param url: Url of the image. - :type url: str - :param iteration_id: Optional. Specifies the id of a particular - iteration to evaluate against. - The default iteration for the project will be used when not specified. + :param iteration_id: The iteration id. Defaults to workspace. :type iteration_id: str + :param tag_ids: A list of tags ids to filter the images. Defaults to + all tagged images when null. Limited to 20. + :type tag_ids: list[str] + :param order_by: The ordering. Defaults to newest. Possible values + include: 'Newest', 'Oldest' + :type order_by: str + :param take: Maximum number of images to return. Defaults to 50, + limited to 256. + :type take: int + :param skip: Number of images to skip before beginning the image + batch. Defaults to 0. + :type skip: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ImagePrediction or ClientRawResponse if raw=true + :return: list or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.ImagePrediction + list[~azure.cognitiveservices.vision.customvision.training.models.Image] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ - image_url = models.ImageUrl(url=url) - # Construct URL - url = self.quick_test_image_url.metadata['url'] + url = self.get_tagged_images.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -1247,64 +1146,67 @@ def quick_test_image_url( query_parameters = {} if iteration_id is not None: query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') + if tag_ids is not None: + query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',', max_items=20, min_items=0) + if order_by is not None: + query_parameters['orderBy'] = self._serialize.query("order_by", order_by, 'str') + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=256, minimum=0) + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') - - # Construct body - body_content = self._serialize.body(image_url, 'ImageUrl') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ImagePrediction', response) + deserialized = self._deserialize('[Image]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - quick_test_image_url.metadata = {'url': '/projects/{projectId}/quicktest/url'} + get_tagged_images.metadata = {'url': '/projects/{projectId}/images/tagged'} - def quick_test_image( - self, project_id, image_data, iteration_id=None, custom_headers=None, raw=False, **operation_config): - """Quick test an image. + def get_tagged_image_count( + self, project_id, iteration_id=None, tag_ids=None, custom_headers=None, raw=False, **operation_config): + """Gets the number of images tagged with the provided {tagIds}. + + 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. :param project_id: The project id. :type project_id: str - :param image_data: Binary image data. Supported formats are JPEG, GIF, - PNG, and BMP. Supports images up to 6MB. - :type image_data: Generator - :param iteration_id: Optional. Specifies the id of a particular - iteration to evaluate against. - The default iteration for the project will be used when not specified. + :param iteration_id: The iteration id. Defaults to workspace. :type iteration_id: str + :param tag_ids: A list of tags ids to filter the images to count. + Defaults to all tags when null. + :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ImagePrediction or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.ImagePrediction - or ~msrest.pipeline.ClientRawResponse + :return: int or ClientRawResponse if raw=true + :rtype: int or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.quick_test_image.metadata['url'] + url = self.get_tagged_image_count.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -1315,63 +1217,58 @@ def quick_test_image( query_parameters = {} if iteration_id is not None: query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') + if tag_ids is not None: + query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'multipart/form-data' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') - - # Construct form data - form_data_content = { - 'imageData': image_data, - } # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, form_content=form_data_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ImagePrediction', response) + deserialized = self._deserialize('int', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - quick_test_image.metadata = {'url': '/projects/{projectId}/quicktest/image'} + get_tagged_image_count.metadata = {'url': '/projects/{projectId}/images/tagged/count'} - def query_predictions( - self, project_id, query, custom_headers=None, raw=False, **operation_config): - """Get images that were sent to your prediction endpoint. + def create_image_tags( + self, project_id, tags=None, custom_headers=None, raw=False, **operation_config): + """Associate a set of images with a set of tags. :param project_id: The project id. :type project_id: str - :param query: Parameters used to query the predictions. Limited to - combining 2 tags. - :type query: - ~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken + :param tags: Image Tag entries to include in this batch. + :type tags: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateEntry] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PredictionQueryResult or ClientRawResponse if raw=true + :return: ImageTagCreateSummary or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryResult + ~azure.cognitiveservices.vision.customvision.training.models.ImageTagCreateSummary or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ + batch = models.ImageTagCreateBatch(tags=tags) + # Construct URL - url = self.query_predictions.metadata['url'] + url = self.create_image_tags.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -1387,10 +1284,9 @@ def query_predictions( header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct body - body_content = self._serialize.body(query, 'PredictionQueryToken') + body_content = self._serialize.body(batch, 'ImageTagCreateBatch') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -1400,104 +1296,80 @@ def query_predictions( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('PredictionQueryResult', response) + deserialized = self._deserialize('ImageTagCreateSummary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - query_predictions.metadata = {'url': '/projects/{projectId}/predictions/query'} + create_image_tags.metadata = {'url': '/projects/{projectId}/images/tags'} - def get_iteration_performance( - self, project_id, iteration_id, threshold=None, overlap_threshold=None, custom_headers=None, raw=False, **operation_config): - """Get detailed performance information about an iteration. + def delete_image_tags( + self, project_id, image_ids, tag_ids, custom_headers=None, raw=False, **operation_config): + """Remove a set of tags from a set of images. - :param project_id: The id of the project the iteration belongs to. + :param project_id: The project id. :type project_id: str - :param iteration_id: The id of the iteration to get. - :type iteration_id: str - :param threshold: The threshold used to determine true predictions. - :type threshold: float - :param overlap_threshold: If applicable, the bounding box overlap - threshold used to determine true predictions. - :type overlap_threshold: float + :param image_ids: Image ids. Limited to 64 images. + :type image_ids: list[str] + :param tag_ids: Tags to be deleted from the specified images. Limited + to 20 tags. + :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: IterationPerformance or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.IterationPerformance - or ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_iteration_performance.metadata['url'] + url = self.delete_image_tags.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - if threshold is not None: - query_parameters['threshold'] = self._serialize.query("threshold", threshold, 'float') - if overlap_threshold is not None: - query_parameters['overlapThreshold'] = self._serialize.query("overlap_threshold", overlap_threshold, 'float') + query_parameters['imageIds'] = self._serialize.query("image_ids", image_ids, '[str]', div=',', max_items=64, min_items=0) + query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',', max_items=20, min_items=0) # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [204]: raise models.CustomVisionErrorException(self._deserialize, response) - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('IterationPerformance', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_image_tags.metadata = {'url': '/projects/{projectId}/images/tags'} - return deserialized - get_iteration_performance.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/performance'} - - def get_image_performances( - self, project_id, iteration_id, tag_ids=None, order_by=None, take=50, skip=0, custom_headers=None, raw=False, **operation_config): - """Get image with its prediction for a given project iteration. + def get_untagged_images( + self, project_id, iteration_id=None, order_by=None, take=50, skip=0, custom_headers=None, raw=False, **operation_config): + """Get untagged images for a given project iteration. 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. :param project_id: The project id. :type project_id: str :param iteration_id: The iteration id. Defaults to workspace. :type iteration_id: str - :param tag_ids: A list of tags ids to filter the images. Defaults to - all tagged images when null. Limited to 20. - :type tag_ids: list[str] :param order_by: The ordering. Defaults to newest. Possible values include: 'Newest', 'Oldest' :type order_by: str @@ -1514,24 +1386,23 @@ def get_image_performances( overrides`. :return: list or ClientRawResponse if raw=true :rtype: - list[~azure.cognitiveservices.vision.customvision.training.models.ImagePerformance] + list[~azure.cognitiveservices.vision.customvision.training.models.Image] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_image_performances.metadata['url'] + url = self.get_untagged_images.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - if tag_ids is not None: - query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',', max_items=20, min_items=0) + if iteration_id is not None: + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') if order_by is not None: query_parameters['orderBy'] = self._serialize.query("order_by", order_by, 'str') if take is not None: @@ -1544,7 +1415,6 @@ def get_image_performances( header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -1554,35 +1424,28 @@ def get_image_performances( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[ImagePerformance]', response) + deserialized = self._deserialize('[Image]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_image_performances.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/performance/images'} + get_untagged_images.metadata = {'url': '/projects/{projectId}/images/untagged'} - def get_image_performance_count( - self, project_id, iteration_id, tag_ids=None, custom_headers=None, raw=False, **operation_config): - """Gets the number of images tagged with the provided {tagIds} that have - prediction results from - training for the provided iteration {iterationId}. + def get_untagged_image_count( + self, project_id, iteration_id=None, custom_headers=None, raw=False, **operation_config): + """Gets the number of untagged 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. + This API returns the images which have no tags for a given project and + optionally an iteration. If no iteration is specified the + current workspace is used. :param project_id: The project id. :type project_id: str :param iteration_id: The iteration id. Defaults to workspace. :type iteration_id: str - :param tag_ids: A list of tags ids to filter the images to count. - Defaults to all tags when null. - :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1594,25 +1457,23 @@ def get_image_performance_count( :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_image_performance_count.metadata['url'] + url = self.get_untagged_image_count.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - if tag_ids is not None: - query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',') + if iteration_id is not None: + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -1622,7 +1483,6 @@ def get_image_performance_count( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('int', response) @@ -1631,28 +1491,41 @@ def get_image_performance_count( return client_raw_response return deserialized - get_image_performance_count.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/performance/images/count'} + get_untagged_image_count.metadata = {'url': '/projects/{projectId}/images/untagged/count'} - def get_projects( - self, custom_headers=None, raw=False, **operation_config): - """Get your projects. + def create_images_from_urls( + self, project_id, images=None, tag_ids=None, custom_headers=None, raw=False, **operation_config): + """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. + + :param project_id: The project id. + :type project_id: str + :param images: + :type images: + list[~azure.cognitiveservices.vision.customvision.training.models.ImageUrlCreateEntry] + :param tag_ids: + :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: list or ClientRawResponse if raw=true + :return: ImageCreateSummary or ClientRawResponse if raw=true :rtype: - list[~azure.cognitiveservices.vision.customvision.training.models.Project] + ~azure.cognitiveservices.vision.customvision.training.models.ImageCreateSummary or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ + batch = models.ImageUrlCreateBatch(images=images, tag_ids=tag_ids) + # Construct URL - url = self.get_projects.metadata['url'] + url = self.create_images_from_urls.metadata['url'] path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -1662,126 +1535,110 @@ def get_projects( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') + + # Construct body + body_content = self._serialize.body(batch, 'ImageUrlCreateBatch') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[Project]', response) + deserialized = self._deserialize('ImageCreateSummary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_projects.metadata = {'url': '/projects'} + create_images_from_urls.metadata = {'url': '/projects/{projectId}/images/urls'} - def create_project( - self, name, description=None, domain_id=None, classification_type=None, target_export_platforms=None, custom_headers=None, raw=False, **operation_config): - """Create a project. + def get_iterations( + self, project_id, custom_headers=None, raw=False, **operation_config): + """Get iterations for the project. - :param name: Name of the project. - :type name: str - :param description: The description of the project. - :type description: str - :param domain_id: The id of the domain to use for this project. - Defaults to General. - :type domain_id: str - :param classification_type: The type of classifier to create for this - project. Possible values include: 'Multiclass', 'Multilabel' - :type classification_type: str - :param target_export_platforms: List of platforms the trained model is - intending exporting to. - :type target_export_platforms: list[str] + :param project_id: The project id. + :type project_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Project or ClientRawResponse if raw=true + :return: list or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.Project + list[~azure.cognitiveservices.vision.customvision.training.models.Iteration] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.create_project.metadata['url'] + url = self.get_iterations.metadata['url'] path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['name'] = self._serialize.query("name", name, 'str') - if description is not None: - query_parameters['description'] = self._serialize.query("description", description, 'str') - if domain_id is not None: - query_parameters['domainId'] = self._serialize.query("domain_id", domain_id, 'str') - if classification_type is not None: - query_parameters['classificationType'] = self._serialize.query("classification_type", classification_type, 'str') - if target_export_platforms is not None: - query_parameters['targetExportPlatforms'] = self._serialize.query("target_export_platforms", target_export_platforms, '[str]', div=',') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Project', response) + deserialized = self._deserialize('[Iteration]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_project.metadata = {'url': '/projects'} + get_iterations.metadata = {'url': '/projects/{projectId}/iterations'} - def get_project( - self, project_id, custom_headers=None, raw=False, **operation_config): - """Get a specific project. + def get_iteration( + self, project_id, iteration_id, custom_headers=None, raw=False, **operation_config): + """Get a specific iteration. - :param project_id: The id of the project to get. + :param project_id: The id of the project the iteration belongs to. :type project_id: str + :param iteration_id: The id of the iteration to get. + :type iteration_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Project or ClientRawResponse if raw=true + :return: Iteration or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.Project + ~azure.cognitiveservices.vision.customvision.training.models.Iteration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_project.metadata['url'] + url = self.get_iteration.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -1793,7 +1650,6 @@ def get_project( header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -1803,23 +1659,24 @@ def get_project( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Project', response) + deserialized = self._deserialize('Iteration', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_project.metadata = {'url': '/projects/{projectId}'} + get_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}'} - def delete_project( - self, project_id, custom_headers=None, raw=False, **operation_config): - """Delete a specific project. + def delete_iteration( + self, project_id, iteration_id, custom_headers=None, raw=False, **operation_config): + """Delete a specific iteration of a project. :param project_id: The project id. :type project_id: str + :param iteration_id: The iteration id. + :type iteration_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1831,10 +1688,11 @@ def delete_project( :class:`CustomVisionErrorException` """ # Construct URL - url = self.delete_project.metadata['url'] + url = self.delete_iteration.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -1845,7 +1703,6 @@ def delete_project( header_parameters = {} if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) @@ -1857,34 +1714,38 @@ def delete_project( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_project.metadata = {'url': '/projects/{projectId}'} + delete_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}'} - def update_project( - self, project_id, updated_project, custom_headers=None, raw=False, **operation_config): - """Update a specific project. + def update_iteration( + self, project_id, iteration_id, name, custom_headers=None, raw=False, **operation_config): + """Update a specific iteration. - :param project_id: The id of the project to update. + :param project_id: Project id. :type project_id: str - :param updated_project: The updated project model. - :type updated_project: - ~azure.cognitiveservices.vision.customvision.training.models.Project + :param iteration_id: Iteration id. + :type iteration_id: str + :param name: Gets or sets the name of the iteration. + :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Project or ClientRawResponse if raw=true + :return: Iteration or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.Project + ~azure.cognitiveservices.vision.customvision.training.models.Iteration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ + updated_iteration = models.Iteration(name=name) + # Construct URL - url = self.update_project.metadata['url'] + url = self.update_iteration.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -1897,10 +1758,9 @@ def update_project( header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct body - body_content = self._serialize.body(updated_project, 'Project') + body_content = self._serialize.body(updated_iteration, 'Iteration') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) @@ -1910,72 +1770,119 @@ def update_project( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Project', response) + deserialized = self._deserialize('Iteration', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_project.metadata = {'url': '/projects/{projectId}'} + update_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}'} - def train_project( - self, project_id, training_type=None, reserved_budget_in_hours=0, force_train=False, notification_email_address=None, custom_headers=None, raw=False, **operation_config): - """Queues project for training. + def get_exports( + self, project_id, iteration_id, custom_headers=None, raw=False, **operation_config): + """Get the list of exports for a specific iteration. :param project_id: The project id. :type project_id: str - :param training_type: The type of training to use to train the project - (default: Regular). Possible values include: 'Regular', 'Advanced' - :type training_type: str - :param reserved_budget_in_hours: The number of hours reserved as - budget for training (if applicable). - :type reserved_budget_in_hours: int - :param force_train: Whether to force train even if dataset and - configuration does not change (default: false). - :type force_train: bool - :param notification_email_address: The email address to send - notification to when training finishes (default: null). - :type notification_email_address: str + :param iteration_id: The iteration id. + :type iteration_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Iteration or ClientRawResponse if raw=true + :return: list or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.Iteration + list[~azure.cognitiveservices.vision.customvision.training.models.Export] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.train_project.metadata['url'] + url = self.get_exports.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - if training_type is not None: - query_parameters['trainingType'] = self._serialize.query("training_type", training_type, 'str') - if reserved_budget_in_hours is not None: - query_parameters['reservedBudgetInHours'] = self._serialize.query("reserved_budget_in_hours", reserved_budget_in_hours, 'int') - if force_train is not None: - query_parameters['forceTrain'] = self._serialize.query("force_train", force_train, 'bool') - if notification_email_address is not None: - query_parameters['notificationEmailAddress'] = self._serialize.query("notification_email_address", notification_email_address, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CustomVisionErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[Export]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_exports.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/export'} + + def export_iteration( + self, project_id, iteration_id, platform, flavor=None, custom_headers=None, raw=False, **operation_config): + """Export a trained iteration. + + :param project_id: The project id. + :type project_id: str + :param iteration_id: The iteration id. + :type iteration_id: str + :param platform: The target platform. Possible values include: + 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' + :type platform: str + :param flavor: The flavor of the target platform. Possible values + include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM', + 'TensorFlowNormal', 'TensorFlowLite' + :type flavor: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Export or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.vision.customvision.training.models.Export or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CustomVisionErrorException` + """ + # Construct URL + url = self.export_iteration.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['platform'] = self._serialize.query("platform", platform, 'str') + if flavor is not None: + query_parameters['flavor'] = self._serialize.query("flavor", flavor, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters, header_parameters) @@ -1985,23 +1892,110 @@ def train_project( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Export', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/export'} + + def get_iteration_performance( + self, project_id, iteration_id, threshold=None, overlap_threshold=None, custom_headers=None, raw=False, **operation_config): + """Get detailed performance information about an iteration. + + :param project_id: The id of the project the iteration belongs to. + :type project_id: str + :param iteration_id: The id of the iteration to get. + :type iteration_id: str + :param threshold: The threshold used to determine true predictions. + :type threshold: float + :param overlap_threshold: If applicable, the bounding box overlap + threshold used to determine true predictions. + :type overlap_threshold: float + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IterationPerformance or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.vision.customvision.training.models.IterationPerformance + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CustomVisionErrorException` + """ + # Construct URL + url = self.get_iteration_performance.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} + if threshold is not None: + query_parameters['threshold'] = self._serialize.query("threshold", threshold, 'float') + if overlap_threshold is not None: + query_parameters['overlapThreshold'] = self._serialize.query("overlap_threshold", overlap_threshold, 'float') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CustomVisionErrorException(self._deserialize, response) + + deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Iteration', response) + deserialized = self._deserialize('IterationPerformance', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - train_project.metadata = {'url': '/projects/{projectId}/train'} + get_iteration_performance.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/performance'} - def get_iterations( - self, project_id, custom_headers=None, raw=False, **operation_config): - """Get iterations for the project. + def get_image_performances( + self, project_id, iteration_id, tag_ids=None, order_by=None, take=50, skip=0, custom_headers=None, raw=False, **operation_config): + """Get image with its prediction for a given project iteration. + + 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. :param project_id: The project id. :type project_id: str + :param iteration_id: The iteration id. Defaults to workspace. + :type iteration_id: str + :param tag_ids: A list of tags ids to filter the images. Defaults to + all tagged images when null. Limited to 20. + :type tag_ids: list[str] + :param order_by: The ordering. Defaults to newest. Possible values + include: 'Newest', 'Oldest' + :type order_by: str + :param take: Maximum number of images to return. Defaults to 50, + limited to 256. + :type take: int + :param skip: Number of images to skip before beginning the image + batch. Defaults to 0. + :type skip: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -2009,28 +2003,36 @@ def get_iterations( overrides`. :return: list or ClientRawResponse if raw=true :rtype: - list[~azure.cognitiveservices.vision.customvision.training.models.Iteration] + list[~azure.cognitiveservices.vision.customvision.training.models.ImagePerformance] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_iterations.metadata['url'] + url = self.get_image_performances.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + if tag_ids is not None: + query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',', max_items=20, min_items=0) + if order_by is not None: + query_parameters['orderBy'] = self._serialize.query("order_by", order_by, 'str') + if take is not None: + query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=256, minimum=0) + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -2040,39 +2042,46 @@ def get_iterations( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[Iteration]', response) + deserialized = self._deserialize('[ImagePerformance]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_iterations.metadata = {'url': '/projects/{projectId}/iterations'} + get_image_performances.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/performance/images'} - def get_iteration( - self, project_id, iteration_id, custom_headers=None, raw=False, **operation_config): - """Get a specific iteration. + def get_image_performance_count( + self, project_id, iteration_id, tag_ids=None, custom_headers=None, raw=False, **operation_config): + """Gets the number of images tagged with the provided {tagIds} that have + prediction results from + training for the provided iteration {iterationId}. - :param project_id: The id of the project the iteration belongs to. + 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. + + :param project_id: The project id. :type project_id: str - :param iteration_id: The id of the iteration to get. + :param iteration_id: The iteration id. Defaults to workspace. :type iteration_id: str + :param tag_ids: A list of tags ids to filter the images to count. + Defaults to all tags when null. + :type tag_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Iteration or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.Iteration - or ~msrest.pipeline.ClientRawResponse + :return: int or ClientRawResponse if raw=true + :rtype: int or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_iteration.metadata['url'] + url = self.get_image_performance_count.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str'), @@ -2082,13 +2091,14 @@ def get_iteration( # Construct parameters query_parameters = {} + if tag_ids is not None: + query_parameters['tagIds'] = self._serialize.query("tag_ids", tag_ids, '[str]', div=',') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -2098,20 +2108,79 @@ def get_iteration( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('int', response) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_image_performance_count.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/performance/images/count'} + + def publish_iteration( + self, project_id, iteration_id, publish_name, prediction_id, custom_headers=None, raw=False, **operation_config): + """Publish a specific iteration. + + :param project_id: The project id. + :type project_id: str + :param iteration_id: The iteration id. + :type iteration_id: str + :param publish_name: The name to give the published iteration. + :type publish_name: str + :param prediction_id: The id of the prediction resource to publish to. + :type prediction_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: bool or ClientRawResponse if raw=true + :rtype: bool or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CustomVisionErrorException` + """ + # Construct URL + url = self.publish_iteration.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'projectId': self._serialize.url("project_id", project_id, 'str'), + 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['publishName'] = self._serialize.query("publish_name", publish_name, 'str') + query_parameters['predictionId'] = self._serialize.query("prediction_id", prediction_id, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CustomVisionErrorException(self._deserialize, response) + + deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Iteration', response) + deserialized = self._deserialize('bool', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}'} + publish_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/publish'} - def delete_iteration( + def unpublish_iteration( self, project_id, iteration_id, custom_headers=None, raw=False, **operation_config): - """Delete a specific iteration of a project. + """Unpublish a specific iteration. :param project_id: The project id. :type project_id: str @@ -2128,7 +2197,7 @@ def delete_iteration( :class:`CustomVisionErrorException` """ # Construct URL - url = self.delete_iteration.metadata['url'] + url = self.unpublish_iteration.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str'), @@ -2143,7 +2212,6 @@ def delete_iteration( header_parameters = {} if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) @@ -2155,38 +2223,83 @@ def delete_iteration( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}'} + unpublish_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/publish'} - def update_iteration( - self, project_id, iteration_id, name, custom_headers=None, raw=False, **operation_config): - """Update a specific iteration. + def delete_prediction( + self, project_id, ids, custom_headers=None, raw=False, **operation_config): + """Delete a set of predicted images and their associated prediction + results. - :param project_id: Project id. + :param project_id: The project id. :type project_id: str - :param iteration_id: Iteration id. - :type iteration_id: str - :param name: Gets or sets the name of the iteration. - :type name: str + :param ids: The prediction ids. Limited to 64. + :type ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Iteration or ClientRawResponse if raw=true + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CustomVisionErrorException` + """ + # Construct URL + url = self.delete_prediction.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), + 'projectId': self._serialize.url("project_id", project_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['ids'] = self._serialize.query("ids", ids, '[str]', div=',', max_items=64, min_items=0) + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.CustomVisionErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_prediction.metadata = {'url': '/projects/{projectId}/predictions'} + + def query_predictions( + self, project_id, query, custom_headers=None, raw=False, **operation_config): + """Get images that were sent to your prediction endpoint. + + :param project_id: The project id. + :type project_id: str + :param query: Parameters used to query the predictions. Limited to + combining 2 tags. + :type query: + ~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryToken + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PredictionQueryResult or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.Iteration + ~azure.cognitiveservices.vision.customvision.training.models.PredictionQueryResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ - updated_iteration = models.Iteration(name=name) - # Construct URL - url = self.update_iteration.metadata['url'] + url = self.query_predictions.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2199,147 +2312,180 @@ def update_iteration( header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct body - body_content = self._serialize.body(updated_iteration, 'Iteration') + body_content = self._serialize.body(query, 'PredictionQueryToken') # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Iteration', response) + deserialized = self._deserialize('PredictionQueryResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}'} + query_predictions.metadata = {'url': '/projects/{projectId}/predictions/query'} - def publish_iteration( - self, project_id, iteration_id, publish_name, prediction_id, custom_headers=None, raw=False, **operation_config): - """Publish a specific iteration. + def quick_test_image( + self, project_id, image_data, iteration_id=None, store=True, custom_headers=None, raw=False, **operation_config): + """Quick test an image. :param project_id: The project id. :type project_id: str - :param iteration_id: The iteration id. + :param image_data: Binary image data. Supported formats are JPEG, GIF, + PNG, and BMP. Supports images up to 6MB. + :type image_data: Generator + :param iteration_id: Optional. Specifies the id of a particular + iteration to evaluate against. + The default iteration for the project will be used when not specified. :type iteration_id: str - :param publish_name: The name to give the published iteration. - :type publish_name: str - :param prediction_id: The id of the prediction resource to publish to. - :type prediction_id: str + :param store: Optional. Specifies whether or not to store the result + of this prediction. The default is true, to store. + :type store: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: bool or ClientRawResponse if raw=true - :rtype: bool or ~msrest.pipeline.ClientRawResponse + :return: ImagePrediction or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.vision.customvision.training.models.ImagePrediction + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.publish_iteration.metadata['url'] + url = self.quick_test_image.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['publishName'] = self._serialize.query("publish_name", publish_name, 'str') - query_parameters['predictionId'] = self._serialize.query("prediction_id", prediction_id, 'str') + if iteration_id is not None: + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') + if store is not None: + query_parameters['store'] = self._serialize.query("store", store, 'bool') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'multipart/form-data' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') + + # Construct form data + form_data_content = { + 'imageData': image_data, + } # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, form_content=form_data_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('bool', response) + deserialized = self._deserialize('ImagePrediction', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - publish_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/publish'} + quick_test_image.metadata = {'url': '/projects/{projectId}/quicktest/image'} - def unpublish_iteration( - self, project_id, iteration_id, custom_headers=None, raw=False, **operation_config): - """Unpublish a specific iteration. + def quick_test_image_url( + self, project_id, url, iteration_id=None, store=True, custom_headers=None, raw=False, **operation_config): + """Quick test an image url. - :param project_id: The project id. + :param project_id: The project to evaluate against. :type project_id: str - :param iteration_id: The iteration id. + :param url: Url of the image. + :type url: str + :param iteration_id: Optional. Specifies the id of a particular + iteration to evaluate against. + The default iteration for the project will be used when not specified. :type iteration_id: str + :param store: Optional. Specifies whether or not to store the result + of this prediction. The default is true, to store. + :type store: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: ImagePrediction or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.vision.customvision.training.models.ImagePrediction + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ + image_url = models.ImageUrl(url=url) + # Construct URL - url = self.unpublish_iteration.metadata['url'] + url = self.quick_test_image_url.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + if iteration_id is not None: + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') + if store is not None: + query_parameters['store'] = self._serialize.query("store", store, 'bool') # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') + + # Construct body + body_content = self._serialize.body(image_url, 'ImageUrl') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImagePrediction', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - unpublish_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/publish'} - def get_exports( - self, project_id, iteration_id, custom_headers=None, raw=False, **operation_config): - """Get the list of exports for a specific iteration. + return deserialized + quick_test_image_url.metadata = {'url': '/projects/{projectId}/quicktest/url'} + + def get_tags( + self, project_id, iteration_id=None, custom_headers=None, raw=False, **operation_config): + """Get the tags for a given project and iteration. :param project_id: The project id. :type project_id: str - :param iteration_id: The iteration id. + :param iteration_id: The iteration id. Defaults to workspace. :type iteration_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -2348,29 +2494,29 @@ def get_exports( overrides`. :return: list or ClientRawResponse if raw=true :rtype: - list[~azure.cognitiveservices.vision.customvision.training.models.Export] + list[~azure.cognitiveservices.vision.customvision.training.models.Tag] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_exports.metadata['url'] + url = self.get_tags.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + if iteration_id is not None: + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -2380,64 +2526,62 @@ def get_exports( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[Export]', response) + deserialized = self._deserialize('[Tag]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_exports.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/export'} + get_tags.metadata = {'url': '/projects/{projectId}/tags'} - def export_iteration( - self, project_id, iteration_id, platform, flavor=None, custom_headers=None, raw=False, **operation_config): - """Export a trained iteration. + def create_tag( + self, project_id, name, description=None, type=None, custom_headers=None, raw=False, **operation_config): + """Create a tag for the project. :param project_id: The project id. :type project_id: str - :param iteration_id: The iteration id. - :type iteration_id: str - :param platform: The target platform. Possible values include: - 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' - :type platform: str - :param flavor: The flavor of the target platform. Possible values - include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM' - :type flavor: str + :param name: The tag name. + :type name: str + :param description: Optional description for the tag. + :type description: str + :param type: Optional type for the tag. Possible values include: + 'Regular', 'Negative' + :type type: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Export or ClientRawResponse if raw=true + :return: Tag or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.Export or + ~azure.cognitiveservices.vision.customvision.training.models.Tag or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.export_iteration.metadata['url'] + url = self.create_tag.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'projectId': self._serialize.url("project_id", project_id, 'str'), - 'iterationId': self._serialize.url("iteration_id", iteration_id, 'str') + 'projectId': self._serialize.url("project_id", project_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['platform'] = self._serialize.query("platform", platform, 'str') - if flavor is not None: - query_parameters['flavor'] = self._serialize.query("flavor", flavor, 'str') + query_parameters['name'] = self._serialize.query("name", name, 'str') + if description is not None: + query_parameters['description'] = self._serialize.query("description", description, 'str') + if type is not None: + query_parameters['type'] = self._serialize.query("type", type, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.post(url, query_parameters, header_parameters) @@ -2447,16 +2591,15 @@ def export_iteration( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Export', response) + deserialized = self._deserialize('Tag', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - export_iteration.metadata = {'url': '/projects/{projectId}/iterations/{iterationId}/export'} + create_tag.metadata = {'url': '/projects/{projectId}/tags'} def get_tag( self, project_id, tag_id, iteration_id=None, custom_headers=None, raw=False, **operation_config): @@ -2500,7 +2643,6 @@ def get_tag( header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.get(url, query_parameters, header_parameters) @@ -2510,7 +2652,6 @@ def get_tag( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('Tag', response) @@ -2555,7 +2696,6 @@ def delete_tag( header_parameters = {} if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) @@ -2610,7 +2750,6 @@ def update_tag( header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct body body_content = self._serialize.body(updated_tag, 'Tag') @@ -2623,7 +2762,6 @@ def update_tag( raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('Tag', response) @@ -2634,14 +2772,23 @@ def update_tag( return deserialized update_tag.metadata = {'url': '/projects/{projectId}/tags/{tagId}'} - def get_tags( - self, project_id, iteration_id=None, custom_headers=None, raw=False, **operation_config): - """Get the tags for a given project and iteration. + def suggest_tags_and_regions( + self, project_id, iteration_id, image_ids, custom_headers=None, raw=False, **operation_config): + """Suggest tags and regions for an array/batch of untagged images. Returns + empty array if no tags are found. + + This API will get suggested tags and regions for an array/batch of + untagged images along with confidences for the tags. It returns an + empty array if no tags are found. + There is a limit of 64 images in the batch. :param project_id: The project id. :type project_id: str - :param iteration_id: The iteration id. Defaults to workspace. + :param iteration_id: IterationId to use for tag and region suggestion. :type iteration_id: str + :param image_ids: Array of image ids tag suggestion are needed for. + Use GetUntaggedImages API to get imageIds. + :type image_ids: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -2649,13 +2796,13 @@ def get_tags( overrides`. :return: list or ClientRawResponse if raw=true :rtype: - list[~azure.cognitiveservices.vision.customvision.training.models.Tag] + list[~azure.cognitiveservices.vision.customvision.training.models.SuggestedTagAndRegion] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ # Construct URL - url = self.get_tags.metadata['url'] + url = self.suggest_tags_and_regions.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -2664,62 +2811,72 @@ def get_tags( # Construct parameters query_parameters = {} - if iteration_id is not None: - query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') + query_parameters['iterationId'] = self._serialize.query("iteration_id", iteration_id, 'str') + query_parameters['imageIds'] = self._serialize.query("image_ids", image_ids, '[str]', div=',', max_items=64, min_items=0) # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[Tag]', response) + deserialized = self._deserialize('[SuggestedTagAndRegion]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_tags.metadata = {'url': '/projects/{projectId}/tags'} + suggest_tags_and_regions.metadata = {'url': '/projects/{projectId}/tagsandregions/suggestions'} - def create_tag( - self, project_id, name, description=None, type=None, custom_headers=None, raw=False, **operation_config): - """Create a tag for the project. + def train_project( + self, project_id, training_type=None, reserved_budget_in_hours=0, force_train=False, notification_email_address=None, selected_tags=None, custom_headers=None, raw=False, **operation_config): + """Queues project for training. :param project_id: The project id. :type project_id: str - :param name: The tag name. - :type name: str - :param description: Optional description for the tag. - :type description: str - :param type: Optional type for the tag. Possible values include: - 'Regular', 'Negative' - :type type: str + :param training_type: The type of training to use to train the project + (default: Regular). Possible values include: 'Regular', 'Advanced' + :type training_type: str + :param reserved_budget_in_hours: The number of hours reserved as + budget for training (if applicable). + :type reserved_budget_in_hours: int + :param force_train: Whether to force train even if dataset and + configuration does not change (default: false). + :type force_train: bool + :param notification_email_address: The email address to send + notification to when training finishes (default: null). + :type notification_email_address: str + :param selected_tags: List of tags selected for this training session, + other tags in the project will be ignored. + :type selected_tags: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Tag or ClientRawResponse if raw=true + :return: Iteration or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.vision.customvision.training.models.Tag or - ~msrest.pipeline.ClientRawResponse + ~azure.cognitiveservices.vision.customvision.training.models.Iteration + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CustomVisionErrorException` """ + training_parameters = None + if selected_tags is not None: + training_parameters = models.TrainingParameters(selected_tags=selected_tags) + # Construct URL - url = self.create_tag.metadata['url'] + url = self.train_project.metadata['url'] path_format_arguments = { 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), 'projectId': self._serialize.url("project_id", project_id, 'str') @@ -2728,34 +2885,95 @@ def create_tag( # Construct parameters query_parameters = {} - query_parameters['name'] = self._serialize.query("name", name, 'str') - if description is not None: - query_parameters['description'] = self._serialize.query("description", description, 'str') - if type is not None: - query_parameters['type'] = self._serialize.query("type", type, 'str') + if training_type is not None: + query_parameters['trainingType'] = self._serialize.query("training_type", training_type, 'str') + if reserved_budget_in_hours is not None: + query_parameters['reservedBudgetInHours'] = self._serialize.query("reserved_budget_in_hours", reserved_budget_in_hours, 'int') + if force_train is not None: + query_parameters['forceTrain'] = self._serialize.query("force_train", force_train, 'bool') + if notification_email_address is not None: + query_parameters['notificationEmailAddress'] = self._serialize.query("notification_email_address", notification_email_address, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) - header_parameters['Training-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str') + + # Construct body + if training_parameters is not None: + body_content = self._serialize.body(training_parameters, 'TrainingParameters') + else: + body_content = None # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.CustomVisionErrorException(self._deserialize, response) deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Iteration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + train_project.metadata = {'url': '/projects/{projectId}/train'} + + def import_project( + self, token, custom_headers=None, raw=False, **operation_config): + """Imports a project. + + :param token: Token generated from the export project call. + :type token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Project or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.vision.customvision.training.models.Project + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CustomVisionErrorException` + """ + # Construct URL + url = self.import_project.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['token'] = self._serialize.query("token", token, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CustomVisionErrorException(self._deserialize, response) + deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Tag', response) + deserialized = self._deserialize('Project', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_tag.metadata = {'url': '/projects/{projectId}/tags'} + import_project.metadata = {'url': '/projects/import'} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/setup.py b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/setup.py index 9130c3e95da5..6016faab4e6c 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/setup.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/setup.py @@ -64,10 +64,10 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,