From 96ee7261d5c3ffac5598c618b7c7499fad34ab12 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Jul 2021 17:52:53 +0000 Subject: [PATCH] feat: Add additional_experiments field to AutoMlTablesInputs (#540) PiperOrigin-RevId: 384483418 Source-Link: https://github.com/googleapis/googleapis/commit/369fd2ade113e707ee29794fe558d7d25955032c Source-Link: https://github.com/googleapis/googleapis-gen/commit/e46a365c25f7417b156eea689f40b127d1ac32c4 feat: Add two new ModelType constants for Video Action Recognition training jobs --- .../instance_v1/types/image_classification.py | 4 +-- .../types/image_object_detection.py | 4 +-- .../instance_v1/types/text_extraction.py | 2 +- .../params_v1/types/video_classification.py | 23 ++++++++------- .../prediction_v1/types/classification.py | 3 +- .../definition_v1/types/automl_tables.py | 4 +++ .../types/automl_video_action_recognition.py | 2 ++ .../export_evaluated_data_items_config.py | 1 - .../services/migration_service/client.py | 22 +++++++-------- .../instance_v1/types/image_classification.py | 4 +-- .../types/image_object_detection.py | 4 +-- .../instance_v1/types/text_extraction.py | 2 +- .../params_v1/types/video_classification.py | 23 ++++++++------- .../prediction_v1/types/classification.py | 3 +- .../aiplatform_v1/test_migration_service.py | 28 +++++++++---------- 15 files changed, 65 insertions(+), 64 deletions(-) diff --git a/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_classification.py b/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_classification.py index 04e7b841a5..477bc90ea5 100644 --- a/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_classification.py +++ b/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_classification.py @@ -26,8 +26,8 @@ class ImageClassificationPredictionInstance(proto.Message): r"""Prediction input format for Image Classification. Attributes: content (str): - The image bytes or GCS URI to make the - prediction on. + The image bytes or Cloud Storage URI to make + the prediction on. mime_type (str): The MIME type of the content of the image. Only the images in below listed MIME types are diff --git a/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_object_detection.py b/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_object_detection.py index 5180c12ece..e8587ea214 100644 --- a/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_object_detection.py +++ b/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_object_detection.py @@ -26,8 +26,8 @@ class ImageObjectDetectionPredictionInstance(proto.Message): r"""Prediction input format for Image Object Detection. Attributes: content (str): - The image bytes or GCS URI to make the - prediction on. + The image bytes or Cloud Storage URI to make + the prediction on. mime_type (str): The MIME type of the content of the image. Only the images in below listed MIME types are diff --git a/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_extraction.py b/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_extraction.py index ba1997ba05..f5d5953b4a 100644 --- a/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_extraction.py +++ b/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_extraction.py @@ -36,7 +36,7 @@ class TextExtractionPredictionInstance(proto.Message): If a key is provided, the batch prediction result will by mapped to this key. If omitted, then the batch prediction result will contain - the entire input instance. AI Platform will not + the entire input instance. Vertex AI will not check if keys in the request are duplicates, so it is up to the caller to ensure the keys are unique. diff --git a/google/cloud/aiplatform/v1/schema/predict/params_v1/types/video_classification.py b/google/cloud/aiplatform/v1/schema/predict/params_v1/types/video_classification.py index 1ab180bbe2..a08b024614 100644 --- a/google/cloud/aiplatform/v1/schema/predict/params_v1/types/video_classification.py +++ b/google/cloud/aiplatform/v1/schema/predict/params_v1/types/video_classification.py @@ -37,16 +37,16 @@ class VideoClassificationPredictionParams(proto.Message): 10,000. segment_classification (bool): Set to true to request segment-level - classification. AI Platform returns labels and + classification. Vertex AI returns labels and their confidence scores for the entire time segment of the video that user specified in the input instance. Default value is true shot_classification (bool): Set to true to request shot-level - classification. AI Platform determines the + classification. Vertex AI determines the boundaries for each camera shot in the entire time segment of the video that user specified in - the input instance. AI Platform then returns + the input instance. Vertex AI then returns labels and their confidence scores for each detected shot, along with the start and end time of the shot. @@ -57,15 +57,14 @@ class VideoClassificationPredictionParams(proto.Message): Default value is false one_sec_interval_classification (bool): Set to true to request classification for a - video at one-second intervals. AI Platform - returns labels and their confidence scores for - each second of the entire time segment of the - video that user specified in the input WARNING: - Model evaluation is not done for this - classification type, the quality of it depends - on the training data, but there are no metrics - provided to describe that quality. Default value - is false + video at one-second intervals. Vertex AI returns + labels and their confidence scores for each + second of the entire time segment of the video + that user specified in the input WARNING: Model + evaluation is not done for this classification + type, the quality of it depends on the training + data, but there are no metrics provided to + describe that quality. Default value is false """ confidence_threshold = proto.Field(proto.FLOAT, number=1,) diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/classification.py b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/classification.py index 490d81e91d..251f6873e4 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/classification.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/classification.py @@ -27,8 +27,7 @@ class ClassificationPredictionResult(proto.Message): Attributes: ids (Sequence[int]): The resource IDs of the AnnotationSpecs that - had been identified, ordered by the confidence - score descendingly. + had been identified. display_names (Sequence[str]): The display names of the AnnotationSpecs that had been identified, order matches the IDs. diff --git a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_tables.py b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_tables.py index f05b633c87..1f462c5188 100644 --- a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_tables.py +++ b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_tables.py @@ -139,6 +139,9 @@ class AutoMlTablesInputs(proto.Message): predictions to a BigQuery table. If this configuration is absent, then the export is not performed. + additional_experiments (Sequence[str]): + Additional experiment flags for the Tables + training pipeline. """ class Transformation(proto.Message): @@ -401,6 +404,7 @@ class TextArrayTransformation(proto.Message): number=10, message=gcastd_export_evaluated_data_items_config.ExportEvaluatedDataItemsConfig, ) + additional_experiments = proto.RepeatedField(proto.STRING, number=11,) class AutoMlTablesMetadata(proto.Message): diff --git a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_video_action_recognition.py b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_video_action_recognition.py index f9eefb8c4d..a67c09ced5 100644 --- a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_video_action_recognition.py +++ b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_video_action_recognition.py @@ -48,6 +48,8 @@ class ModelType(proto.Enum): MODEL_TYPE_UNSPECIFIED = 0 CLOUD = 1 MOBILE_VERSATILE_1 = 2 + MOBILE_JETSON_VERSATILE_1 = 3 + MOBILE_CORAL_VERSATILE_1 = 4 model_type = proto.Field(proto.ENUM, number=1, enum=ModelType,) diff --git a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/export_evaluated_data_items_config.py b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/export_evaluated_data_items_config.py index 47d910fefb..9aaeac9389 100644 --- a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/export_evaluated_data_items_config.py +++ b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/export_evaluated_data_items_config.py @@ -33,7 +33,6 @@ class ExportEvaluatedDataItemsConfig(proto.Message): If not specified, then results are exported to the following auto-created BigQuery table: - :export_evaluated_examples__.evaluated_examples override_existing_table (bool): If true and an export destination is diff --git a/google/cloud/aiplatform_v1/services/migration_service/client.py b/google/cloud/aiplatform_v1/services/migration_service/client.py index 162818246f..fb8d9a9a4d 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/client.py @@ -195,32 +195,32 @@ def parse_dataset_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def dataset_path(project: str, location: str, dataset: str,) -> str: + def dataset_path(project: str, dataset: str,) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/locations/{location}/datasets/{dataset}".format( - project=project, location=location, dataset=dataset, + return "projects/{project}/datasets/{dataset}".format( + project=project, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", - path, - ) + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod - def dataset_path(project: str, dataset: str,) -> str: + def dataset_path(project: str, location: str, dataset: str,) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( - project=project, dataset=dataset, + return "projects/{project}/locations/{location}/datasets/{dataset}".format( + project=project, location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod diff --git a/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_classification.py b/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_classification.py index 94f46a1af3..02e95ba9c7 100644 --- a/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_classification.py +++ b/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_classification.py @@ -28,8 +28,8 @@ class ImageClassificationPredictionInstance(proto.Message): r"""Prediction input format for Image Classification. Attributes: content (str): - The image bytes or GCS URI to make the - prediction on. + The image bytes or Cloud Storage URI to make + the prediction on. mime_type (str): The MIME type of the content of the image. Only the images in below listed MIME types are diff --git a/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_object_detection.py b/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_object_detection.py index bd250ab219..0b9aadc101 100644 --- a/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_object_detection.py +++ b/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/image_object_detection.py @@ -28,8 +28,8 @@ class ImageObjectDetectionPredictionInstance(proto.Message): r"""Prediction input format for Image Object Detection. Attributes: content (str): - The image bytes or GCS URI to make the - prediction on. + The image bytes or Cloud Storage URI to make + the prediction on. mime_type (str): The MIME type of the content of the image. Only the images in below listed MIME types are diff --git a/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_extraction.py b/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_extraction.py index a52c7df050..ffecb3de51 100644 --- a/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_extraction.py +++ b/schema/predict/instance/google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_extraction.py @@ -38,7 +38,7 @@ class TextExtractionPredictionInstance(proto.Message): If a key is provided, the batch prediction result will by mapped to this key. If omitted, then the batch prediction result will contain - the entire input instance. AI Platform will not + the entire input instance. Vertex AI will not check if keys in the request are duplicates, so it is up to the caller to ensure the keys are unique. diff --git a/schema/predict/params/google/cloud/aiplatform/v1/schema/predict/params_v1/types/video_classification.py b/schema/predict/params/google/cloud/aiplatform/v1/schema/predict/params_v1/types/video_classification.py index 4f57fe0d3c..06b2347eb6 100644 --- a/schema/predict/params/google/cloud/aiplatform/v1/schema/predict/params_v1/types/video_classification.py +++ b/schema/predict/params/google/cloud/aiplatform/v1/schema/predict/params_v1/types/video_classification.py @@ -39,16 +39,16 @@ class VideoClassificationPredictionParams(proto.Message): 10,000. segment_classification (bool): Set to true to request segment-level - classification. AI Platform returns labels and + classification. Vertex AI returns labels and their confidence scores for the entire time segment of the video that user specified in the input instance. Default value is true shot_classification (bool): Set to true to request shot-level - classification. AI Platform determines the + classification. Vertex AI determines the boundaries for each camera shot in the entire time segment of the video that user specified in - the input instance. AI Platform then returns + the input instance. Vertex AI then returns labels and their confidence scores for each detected shot, along with the start and end time of the shot. @@ -59,15 +59,14 @@ class VideoClassificationPredictionParams(proto.Message): Default value is false one_sec_interval_classification (bool): Set to true to request classification for a - video at one-second intervals. AI Platform - returns labels and their confidence scores for - each second of the entire time segment of the - video that user specified in the input WARNING: - Model evaluation is not done for this - classification type, the quality of it depends - on the training data, but there are no metrics - provided to describe that quality. Default value - is false + video at one-second intervals. Vertex AI returns + labels and their confidence scores for each + second of the entire time segment of the video + that user specified in the input WARNING: Model + evaluation is not done for this classification + type, the quality of it depends on the training + data, but there are no metrics provided to + describe that quality. Default value is false """ confidence_threshold = proto.Field( diff --git a/schema/predict/prediction/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/classification.py b/schema/predict/prediction/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/classification.py index 2cc31f3476..f14b084951 100644 --- a/schema/predict/prediction/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/classification.py +++ b/schema/predict/prediction/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/classification.py @@ -29,8 +29,7 @@ class ClassificationPredictionResult(proto.Message): Attributes: ids (Sequence[int]): The resource IDs of the AnnotationSpecs that - had been identified, ordered by the confidence - score descendingly. + had been identified. display_names (Sequence[str]): The display names of the AnnotationSpecs that had been identified, order matches the IDs. diff --git a/tests/unit/gapic/aiplatform_v1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1/test_migration_service.py index c60e86af14..1f782b88aa 100644 --- a/tests/unit/gapic/aiplatform_v1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_migration_service.py @@ -1700,20 +1700,18 @@ def test_parse_dataset_path(): def test_dataset_path(): project = "squid" - location = "clam" - dataset = "whelk" - expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( - project=project, location=location, dataset=dataset, + dataset = "clam" + expected = "projects/{project}/datasets/{dataset}".format( + project=project, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, location, dataset) + actual = MigrationServiceClient.dataset_path(project, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "octopus", - "location": "oyster", - "dataset": "nudibranch", + "project": "whelk", + "dataset": "octopus", } path = MigrationServiceClient.dataset_path(**expected) @@ -1723,18 +1721,20 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "cuttlefish" - dataset = "mussel" - expected = "projects/{project}/datasets/{dataset}".format( - project=project, dataset=dataset, + project = "oyster" + location = "nudibranch" + dataset = "cuttlefish" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + project=project, location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "winkle", + "project": "mussel", + "location": "winkle", "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected)