Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59d442e

Browse files
author
Rebecca Taylor
committed
Add details about dataset and model IDs (versus names) to AutoML Video OT code samples
1 parent a4c6103 commit 59d442e

11 files changed

+62
-12
lines changed

video/cloud-client/automl/v1beta1/automl_video_object_tracking_batch_predict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def sample_batch_predict(gcs_output_prefix, model_id, project):
3939
request
4040
in your Google Cloud Storage bucket.
4141
You must have write permissions to the Google Cloud Storage bucket.
42+
model_id Model ID, e.g. VOT1234567890123456789
4243
project Required. Your Google Cloud Project ID.
4344
"""
4445

video/cloud-client/automl/v1beta1/automl_video_object_tracking_create_dataset.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,15 @@ def sample_create_dataset(display_name, project):
6363
response = client.create_dataset(parent, dataset)
6464
print(u"Created Dataset.")
6565
dataset = response
66+
# Print out the full name of the created dataset.
67+
#
68+
# This will have the format:
69+
# projects/[Google Cloud Project Number]/locations/us-central1/datasets/VOT1234567890123456789
70+
#
6671
print(u"Name: {}".format(dataset.name))
72+
# Print out the Display Name (the text you provided during creation)
6773
print(u"Display Name: {}".format(dataset.display_name))
74+
# Print out the user-provided description (may be blank)
6875
print(u"Description: {}".format(dataset.description))
6976
# The number of examples in the dataset, if any.
7077
# Added by importing data via import_data

video/cloud-client/automl/v1beta1/automl_video_object_tracking_delete_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def sample_delete_dataset(dataset_id, project):
3535
Delete Dataset
3636
3737
Args:
38-
dataset_id Dataset ID
38+
dataset_id Dataset ID, e.g. VOT1234567890123456789
3939
project Required. Your Google Cloud Project ID.
4040
"""
4141

video/cloud-client/automl/v1beta1/automl_video_object_tracking_delete_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def sample_delete_model(model_id, project):
3535
Delete Model
3636
3737
Args:
38+
model_id Model ID, e.g. VOT1234567890123456789
3839
project Required. Your Google Cloud Project ID.
3940
"""
4041

video/cloud-client/automl/v1beta1/automl_video_object_tracking_get_dataset.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# sample-metadata
2323
# title: Get Dataset
24-
# description: Get Dataset
24+
# description: Get dataset and print dataset details
2525
# usage: python3 samples/v1beta1/automl_video_object_tracking_get_dataset.py [--dataset_id "[Dataset ID]"] [--project "[Google Cloud Project ID]"]
2626
import sys
2727

@@ -32,10 +32,10 @@
3232

3333
def sample_get_dataset(dataset_id, project):
3434
"""
35-
Get Dataset
35+
Get dataset and print dataset details
3636
3737
Args:
38-
dataset_id Dataset ID
38+
dataset_id Dataset ID, e.g. VOT1234567890123456789
3939
project Required. Your Google Cloud Project ID.
4040
"""
4141

@@ -47,8 +47,15 @@ def sample_get_dataset(dataset_id, project):
4747

4848
response = client.get_dataset(name)
4949
dataset = response
50+
# Print out the full name of the created dataset.
51+
#
52+
# This will have the format:
53+
# projects/[Google Cloud Project Number]/locations/us-central1/datasets/VOT1234567890123456789
54+
#
5055
print(u"Name: {}".format(dataset.name))
56+
# Print out the Display Name (the text you provided during creation)
5157
print(u"Display Name: {}".format(dataset.display_name))
58+
# Print out the user-provided description (may be blank)
5259
print(u"Description: {}".format(dataset.description))
5360
# The number of examples in the dataset, if any.
5461
# Added by importing data via import_data

video/cloud-client/automl/v1beta1/automl_video_object_tracking_get_model.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# sample-metadata
2323
# title: Get Model
24-
# description: Get Model
24+
# description: Get model and print model details
2525
# usage: python3 samples/v1beta1/automl_video_object_tracking_get_model.py [--model_id "[Model ID]"] [--project "[Google Cloud Project ID]"]
2626
import sys
2727

@@ -32,9 +32,10 @@
3232

3333
def sample_get_model(model_id, project):
3434
"""
35-
Get Model
35+
Get model and print model details
3636
3737
Args:
38+
model_id Model ID, e.g. VOT1234567890123456789
3839
project Required. Your Google Cloud Project ID.
3940
"""
4041

@@ -46,8 +47,18 @@ def sample_get_model(model_id, project):
4647

4748
response = client.get_model(name)
4849
model = response
50+
# Print out the full name of the created model.
51+
#
52+
# This will have the format:
53+
# projects/[Google Cloud Project Number]/locations/us-central1/models/VOT1234567890123456789
54+
#
4955
print(u"Model name: {}".format(model.name))
56+
# Print out the Display Name (the text you provided during creation)
5057
print(u"Display name: {}".format(model.display_name))
58+
# Print out the ID of the dataset used to create this model.
59+
#
60+
# Note: this is the Dataset ID, e.g. VOT1234567890123456789
61+
#
5162
print(u"Dataset ID: {}".format(model.dataset_id))
5263
print(u"Create time: {}".format(model.create_time))
5364
print(u"Update time: {}".format(model.update_time))

video/cloud-client/automl/v1beta1/automl_video_object_tracking_get_model_evaluation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def sample_get_model_evaluation(evaluation_id, model_id, project):
3535
Get Model Evaluation
3636
3737
Args:
38+
model_id Model ID, e.g. VOT1234567890123456789
3839
project Required. Your Google Cloud Project ID.
3940
"""
4041

video/cloud-client/automl/v1beta1/automl_video_object_tracking_import_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def sample_import_data(dataset_id, project):
3535
Import training data into dataset
3636
3737
Args:
38-
dataset_id Dataset ID
38+
dataset_id Dataset ID, e.g. VOT1234567890123456789
3939
project Required. Your Google Cloud Project ID.
4040
"""
4141

video/cloud-client/automl/v1beta1/automl_video_object_tracking_list_datasets.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# sample-metadata
2323
# title: List Datasets
24-
# description: List Datasets
24+
# description: List datasets and print each details of each dataset
2525
# usage: python3 samples/v1beta1/automl_video_object_tracking_list_datasets.py [--project "[Google Cloud Project ID]"]
2626
import sys
2727

@@ -32,7 +32,7 @@
3232

3333
def sample_list_datasets(project):
3434
"""
35-
List Datasets
35+
List datasets and print each details of each dataset
3636
3737
Args:
3838
project Required. Your Google Cloud Project ID.
@@ -50,8 +50,15 @@ def sample_list_datasets(project):
5050
# Iterate over all results
5151
for response_item in client.list_datasets(parent, filter_=filter_):
5252
dataset = response_item
53+
# Print out the full name of the created dataset.
54+
#
55+
# This will have the format:
56+
# projects/[Google Cloud Project Number]/locations/us-central1/datasets/VOT1234567890123456789
57+
#
5358
print(u"Name: {}".format(dataset.name))
59+
# Print out the Display Name (the text you provided during creation)
5460
print(u"Display Name: {}".format(dataset.display_name))
61+
# Print out the user-provided description (may be blank)
5562
print(u"Description: {}".format(dataset.description))
5663
# The number of examples in the dataset, if any.
5764
# Added by importing data via import_data

video/cloud-client/automl/v1beta1/automl_video_object_tracking_list_model_evaluations.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131

3232

3333
def sample_list_model_evaluations(project, model_id):
34-
"""List Model Evaluations"""
34+
"""
35+
List Model Evaluations
36+
37+
Args:
38+
model_id Model ID, e.g. VOT1234567890123456789
39+
"""
3540

3641
client = automl_v1beta1.AutoMlClient()
3742

video/cloud-client/automl/v1beta1/automl_video_object_tracking_list_models.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# sample-metadata
2323
# title: List Models
24-
# description: List Models
24+
# description: List models and print details of each dataset
2525
# usage: python3 samples/v1beta1/automl_video_object_tracking_list_models.py [--filter "video_object_tracking_model_metadata:*"] [--project "[Google Cloud Project ID]"]
2626
import sys
2727

@@ -32,7 +32,7 @@
3232

3333
def sample_list_models(filter_, project):
3434
"""
35-
List Models
35+
List models and print details of each dataset
3636
3737
Args:
3838
filter_ An expression for filtering the results of the request.
@@ -49,8 +49,18 @@ def sample_list_models(filter_, project):
4949
# Iterate over all results
5050
for response_item in client.list_models(parent, filter_=filter_):
5151
model = response_item
52+
# Print out the full name of the created model.
53+
#
54+
# This will have the format:
55+
# projects/[Google Cloud Project Number]/locations/us-central1/models/VOT1234567890123456789
56+
#
5257
print(u"Model name: {}".format(model.name))
58+
# Print out the Display Name (the text you provided during creation)
5359
print(u"Display name: {}".format(model.display_name))
60+
# Print out the ID of the dataset used to create this model.
61+
#
62+
# Note: this is the Dataset ID, e.g. VOT1234567890123456789
63+
#
5464
print(u"Dataset ID: {}".format(model.dataset_id))
5565
print(u"Create time: {}".format(model.create_time))
5666
print(u"Update time: {}".format(model.update_time))

0 commit comments

Comments
 (0)