Files
model_garden/notebooks/community/migration/UJ15 AutoML for vision with Vertex AI Video Object Tracking.ipynb
T

75 KiB

In [ ]:
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Vertex SDK: AutoML video object tracking model

Installation

Install the latest (preview) version of Vertex SDK.

In [ ]:
! pip3 install -U google-cloud-aiplatform --user

Install the Google cloud-storage library as well.

In [ ]:
! pip3 install google-cloud-storage

Restart the Kernel

Once you've installed the Vertex SDK and Google cloud-storage, you need to restart the notebook kernel so it can find the packages.

In [ ]:
import os

if not os.getenv("AUTORUN"):
    # Automatically restart kernel after installs
    import IPython

    app = IPython.Application.instance()
    app.kernel.do_shutdown(True)

Before you begin

GPU run-time

Make sure you're running this notebook in a GPU runtime if you have that option. In Colab, select Runtime > Change Runtime Type > GPU

Set up your GCP project

The following steps are required, regardless of your notebook environment.

  1. Select or create a GCP project. When you first create an account, you get a $300 free credit towards your compute/storage costs.

  2. Make sure that billing is enabled for your project.

  3. Enable the Vertex APIs and Compute Engine APIs.

  4. Google Cloud SDK is already installed in Google Cloud Notebooks.

  5. Enter your project ID in the cell below. Then run the cell to make sure the Cloud SDK uses the right project for all the commands in this notebook.

Note: Jupyter runs lines prefixed with ! as shell commands, and it interpolates Python variables prefixed with $ into these commands.

In [ ]:
PROJECT_ID = "[your-project-id]"  # @param {type:"string"}
In [ ]:
if PROJECT_ID == "" or PROJECT_ID is None or PROJECT_ID == "[your-project-id]":
    # Get your GCP project id from gcloud
    shell_output = !gcloud config list --format 'value(core.project)' 2>/dev/null
    PROJECT_ID = shell_output[0]
    print("Project ID:", PROJECT_ID)
In [ ]:
! gcloud config set project $PROJECT_ID

Region

You can also change the REGION variable, which is used for operations throughout the rest of this notebook. Below are regions supported for Vertex AI. We recommend when possible, to choose the region closest to you.

  • Americas: us-central1
  • Europe: europe-west4
  • Asia Pacific: asia-east1

You cannot use a Multi-Regional Storage bucket for training with Vertex. Not all regions provide support for all Vertex services. For the latest support per region, see Region support for Vertex AI services

In [ ]:
REGION = "us-central1"  # @param {type: "string"}

Timestamp

If you are in a live tutorial session, you might be using a shared test account or project. To avoid name collisions between users on resources created, you create a timestamp for each instance session, and append onto the name of resources which will be created in this tutorial.

In [ ]:
from datetime import datetime

TIMESTAMP = datetime.now().strftime("%Y%m%d%H%M%S")

Authenticate your GCP account

If you are using Google Cloud Notebooks, your environment is already authenticated. Skip this step.

Note: If you are on an Vertex notebook and run the cell, the cell knows to skip executing the authentication steps.

In [ ]:
import os
import sys

# If you are running this notebook in Colab, run this cell and follow the
# instructions to authenticate your Google Cloud account. This provides access
# to your Cloud Storage bucket and lets you submit training jobs and prediction
# requests.

# If on Vertex, then don't execute this code
if not os.path.exists("/opt/deeplearning/metadata/env_version"):
    if "google.colab" in sys.modules:
        from google.colab import auth as google_auth

        google_auth.authenticate_user()

    # If you are running this tutorial in a notebook locally, replace the string
    # below with the path to your service account key and run this cell to
    # authenticate your Google Cloud account.
    else:
        %env GOOGLE_APPLICATION_CREDENTIALS your_path_to_credentials.json

    # Log in to your account on Google Cloud
    ! gcloud auth login

Create a Cloud Storage bucket

The following steps are required, regardless of your notebook environment.

This tutorial is designed to use training data that is in a public Cloud Storage bucket and a local Cloud Storage bucket for your batch predictions. You may alternatively use your own training data that you have stored in a local Cloud Storage bucket.

Set the name of your Cloud Storage bucket below. It must be unique across all Cloud Storage buckets.

In [ ]:
BUCKET_NAME = "[your-bucket-name]"  # @param {type:"string"}
In [ ]:
if BUCKET_NAME == "" or BUCKET_NAME is None or BUCKET_NAME == "[your-bucket-name]":
    BUCKET_NAME = PROJECT_ID + "aip-" + TIMESTAMP

Only if your bucket doesn't already exist: Run the following cell to create your Cloud Storage bucket.

In [ ]:
! gcloud storage buckets create --location=$REGION gs://$BUCKET_NAME

Finally, validate access to your Cloud Storage bucket by examining its contents:

In [ ]:
! gcloud storage ls --all-versions --long gs://$BUCKET_NAME

Set up variables

Next, set up some variables used throughout the tutorial.

Import libraries and define constants

Import Vertex SDK

Import the Vertex SDK into our Python environment.

In [ ]:
import os
import sys
import time

from google.cloud.aiplatform import gapic as aip
from google.protobuf import json_format
from google.protobuf.json_format import MessageToJson, ParseDict
from google.protobuf.struct_pb2 import Struct, Value

Vertex AI constants

Setup up the following constants for Vertex AI:

  • API_ENDPOINT: The Vertex AI API service endpoint for dataset, model, job, pipeline and endpoint services.
  • PARENT: The Vertex AI location root path for dataset, model and endpoint resources.
In [ ]:
# API Endpoint
API_ENDPOINT = "{}-aiplatform.googleapis.com".format(REGION)

# Vertex AI location root path for your dataset, model and endpoint resources
PARENT = "projects/" + PROJECT_ID + "/locations/" + REGION

AutoML constants

Next, setup constants unique to AutoML video object tracking datasets and training:

  • Dataset Schemas: Tells the managed dataset service which type of dataset it is.
  • Data Labeling (Annotations) Schemas: Tells the managed dataset service how the data is labeled (annotated).
  • Dataset Training Schemas: Tells the Vertex AI Pipelines service the task (e.g., classification) to train the model for.
In [ ]:
# Video Dataset type
VIDEO_SCHEMA = "google-cloud-aiplatform/schema/dataset/metadata/video_1.0.0.yaml"
# Video Labeling type
IMPORT_SCHEMA_VIDEO_OBJECT_TRACKING = "gs://google-cloud-aiplatform/schema/dataset/ioformat/video_object_tracking_io_format_1.0.0.yaml"
# Video Training task
TRAINING_VIDEO_OBJECT_TRACKING_SCHEMA = "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_video_object_tracking_1.0.0.yaml"

Clients

The Vertex SDK works as a client/server model. On your side (the Python script) you will create a client that sends requests and receives responses from the server (Vertex).

You will use several clients in this tutorial, so set them all up upfront.

  • Dataset Service for managed datasets.
  • Model Service for managed models.
  • Pipeline Service for training.
  • Endpoint Service for deployment.
  • Job Service for batch jobs and custom training.
  • Prediction Service for serving. Note: Prediction has a different service endpoint.
In [ ]:
# client options same for all services
client_options = {"api_endpoint": API_ENDPOINT}


def create_dataset_client():
    client = aip.DatasetServiceClient(client_options=client_options)
    return client


def create_model_client():
    client = aip.ModelServiceClient(client_options=client_options)
    return client


def create_pipeline_client():
    client = aip.PipelineServiceClient(client_options=client_options)
    return client


def create_endpoint_client():
    client = aip.EndpointServiceClient(client_options=client_options)
    return client


def create_prediction_client():
    client = aip.PredictionServiceClient(client_options=client_options)
    return client


def create_job_client():
    client = aip.JobServiceClient(client_options=client_options)
    return client


clients = {}
clients["dataset"] = create_dataset_client()
clients["model"] = create_model_client()
clients["pipeline"] = create_pipeline_client()
clients["endpoint"] = create_endpoint_client()
clients["prediction"] = create_prediction_client()
clients["job"] = create_job_client()

for client in clients.items():
    print(client)
In [ ]:
IMPORT_FILE = "gs://automl-video-demo-data/traffic_videos/traffic_videos_labels.csv"
In [ ]:
! gcloud storage cat $IMPORT_FILE | head -n 10

Example output:

gs://automl-video-demo-data/traffic_videos/highway_005.mp4,sedan,1565750291672021,11.933333,0.509205,0.594283,,,0.728737,0.760959,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,pickup_suv_van,1565750291672171,17.566666,0.761241,0.498466,,,0.948839,0.668524,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,pickup_suv_van,1565750291672223,20.433333,0.000000,0.465235,,,0.142638,0.665644,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,pickup_suv_van,1565750291672347,25.766666,0.486523,0.592331,,,0.720611,0.776687,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,pickup_suv_van,1565750291672575,28.966666,0.578534,0.652778,,,0.828647,0.862967,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,pickup_suv_van,1565750291672549,28.966666,0.000000,0.518571,,,0.148841,0.737677,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,pickup_suv_van,1565750291672599,28.966666,0.106979,0.458078,,,0.377877,0.678937,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,pickup_suv_van,1565715798494273,32.466666,0.333083,0.485473,,,0.542722,0.647774,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,sedan,1565715798494439,36.433333,0.935638,0.564839,,,1.000000,0.672182,,
gs://automl-video-demo-data/traffic_videos/highway_005.mp4,pickup_suv_van,1565715798494381,36.433333,0.000000,0.455703,,,0.164878,0.660083,,

Create a dataset

Request

In [ ]:
DATA_SCHEMA = VIDEO_SCHEMA

dataset = {
    "display_name": "traffic_" + TIMESTAMP,
    "metadata_schema_uri": "gs://" + DATA_SCHEMA,
}

print(
    MessageToJson(
        aip.CreateDatasetRequest(parent=PARENT, dataset=dataset).__dict__["_pb"]
    )
)

Example output:

{
  "parent": "projects/migration-ucaip-training/locations/us-central1",
  "dataset": {
    "displayName": "traffic_20210310013516",
    "metadataSchemaUri": "gs://google-cloud-aiplatform/schema/dataset/metadata/video_1.0.0.yaml"
  }
}

Call

In [ ]:
request = clients["dataset"].create_dataset(parent=PARENT, dataset=dataset)

Response

In [ ]:
result = request.result()

print(MessageToJson(result.__dict__["_pb"]))

Example output:

{
  "name": "projects/116273516712/locations/us-central1/datasets/7534187925055995904",
  "displayName": "traffic_20210310013516",
  "metadataSchemaUri": "gs://google-cloud-aiplatform/schema/dataset/metadata/video_1.0.0.yaml",
  "labels": {
    "aiplatform.googleapis.com/dataset_metadata_schema": "VIDEO"
  },
  "metadata": {
    "dataItemSchemaUri": "gs://google-cloud-aiplatform/schema/dataset/dataitem/video_1.0.0.yaml"
  }
}
In [ ]:
# The full unique ID for the dataset
dataset_id = result.name
# The short numeric ID for the dataset
dataset_short_id = dataset_id.split("/")[-1]

print(dataset_id)

Request

In [ ]:
LABEL_SCHEMA = IMPORT_SCHEMA_VIDEO_OBJECT_TRACKING

import_config = {
    "gcs_source": {"uris": [IMPORT_FILE]},
    "import_schema_uri": LABEL_SCHEMA,
}

print(
    MessageToJson(
        aip.ImportDataRequest(
            name=dataset_short_id, import_configs=[import_config]
        ).__dict__["_pb"]
    )
)

Example output:

{
  "name": "7534187925055995904",
  "importConfigs": [
    {
      "gcsSource": {
        "uris": [
          "gs://automl-video-demo-data/traffic_videos/traffic_videos_labels.csv"
        ]
      },
      "importSchemaUri": "gs://google-cloud-aiplatform/schema/dataset/ioformat/video_object_tracking_io_format_1.0.0.yaml"
    }
  ]
}

Call

In [ ]:
request = clients["dataset"].import_data(
    name=dataset_id, import_configs=[import_config]
)

Response

In [ ]:
result = request.result()

print(MessageToJson(result.__dict__["_pb"]))

Example output:

{}

Train a model

Request

In [ ]:
TRAINING_SCHEMA = TRAINING_VIDEO_OBJECT_TRACKING_SCHEMA

task = Value(struct_value=Struct(fields={"model_type": Value(string_value="CLOUD")}))

training_pipeline = {
    "display_name": "traffic_" + TIMESTAMP,
    "training_task_definition": TRAINING_SCHEMA,
    "training_task_inputs": task,
    "input_data_config": {
        "dataset_id": dataset_short_id,
        "fraction_split": {"training_fraction": 0.8, "test_fraction": 0.2},
    },
    "model_to_upload": {"display_name": "traffic_" + TIMESTAMP},
}

print(
    MessageToJson(
        aip.CreateTrainingPipelineRequest(
            parent=PARENT, training_pipeline=training_pipeline
        ).__dict__["_pb"]
    )
)

Example output:

{
  "parent": "projects/migration-ucaip-training/locations/us-central1",
  "trainingPipeline": {
    "displayName": "traffic_20210310013516",
    "inputDataConfig": {
      "datasetId": "7534187925055995904",
      "fractionSplit": {
        "trainingFraction": 0.8,
        "testFraction": 0.2
      }
    },
    "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_video_object_tracking_1.0.0.yaml",
    "trainingTaskInputs": {
      "model_type": "CLOUD"
    },
    "modelToUpload": {
      "displayName": "traffic_20210310013516"
    }
  }
}

Call

In [ ]:
request = clients["pipeline"].create_training_pipeline(
    parent=PARENT, training_pipeline=training_pipeline
)

Response

In [ ]:
print(MessageToJson(request.__dict__["_pb"]))

Example output:

{
  "name": "projects/116273516712/locations/us-central1/trainingPipelines/4612961451915608064",
  "displayName": "traffic_20210310013516",
  "inputDataConfig": {
    "datasetId": "7534187925055995904",
    "fractionSplit": {
      "trainingFraction": 0.8,
      "testFraction": 0.2
    }
  },
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_video_object_tracking_1.0.0.yaml",
  "trainingTaskInputs": {
    "modelType": "CLOUD"
  },
  "modelToUpload": {
    "displayName": "traffic_20210310013516"
  },
  "state": "PIPELINE_STATE_PENDING",
  "createTime": "2021-03-10T13:09:36.473816Z",
  "updateTime": "2021-03-10T13:09:36.473816Z"
}
In [ ]:
# The full unique ID for the training pipeline
training_pipeline_id = request.name
# The short numeric ID for the training pipeline
training_pipeline_short_id = training_pipeline_id.split("/")[-1]

print(training_pipeline_id)

Call

In [ ]:
request = clients["pipeline"].get_training_pipeline(name=training_pipeline_id)

Response

In [ ]:
print(MessageToJson(request.__dict__["_pb"]))

Example output:

{
  "name": "projects/116273516712/locations/us-central1/trainingPipelines/4612961451915608064",
  "displayName": "traffic_20210310013516",
  "inputDataConfig": {
    "datasetId": "7534187925055995904",
    "fractionSplit": {
      "trainingFraction": 0.8,
      "testFraction": 0.2
    }
  },
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_video_object_tracking_1.0.0.yaml",
  "trainingTaskInputs": {
    "modelType": "CLOUD"
  },
  "modelToUpload": {
    "displayName": "traffic_20210310013516"
  },
  "state": "PIPELINE_STATE_PENDING",
  "createTime": "2021-03-10T13:09:36.473816Z",
  "updateTime": "2021-03-10T13:09:36.473816Z"
}
In [ ]:
while True:
    response = clients["pipeline"].get_training_pipeline(name=training_pipeline_id)
    if response.state != aip.PipelineState.PIPELINE_STATE_SUCCEEDED:
        print("Training job has not completed:", response.state)
        model_to_deploy_name = None
        if response.state == aip.PipelineState.PIPELINE_STATE_FAILED:
            break
    else:
        model_id = response.model_to_upload.name
        print("Training Time:", response.end_time - response.start_time)
        break
    time.sleep(60)

print(model_id)

Evaluate the model

Call

In [ ]:
request = clients["model"].list_model_evaluations(parent=model_id)

Response

In [ ]:
import json

model_evaluations = [json.loads(MessageToJson(me.__dict__["_pb"])) for me in request]
# The evaluation slice
evaluation_slice = request.model_evaluations[0].name

print(json.dumps(model_evaluations, indent=2))

Example output:

[
  {
    "name": "projects/116273516712/locations/us-central1/models/6125898247828406272/evaluations/305090287452028928",
    "metricsSchemaUri": "gs://google-cloud-aiplatform/schema/modelevaluation/video_object_tracking_metrics_1.0.0.yaml",
    "metrics": {
      "boundingBoxMetrics": [
        {
          "meanAveragePrecision": 0.34263912,
          "iouThreshold": 0.5,
          "confidenceMetrics": [
            {
              "precision": 0.36842105,
              "recall": 1.0,
              "f1Score": 0.53846157
            },
            {
              "precision": 0.088,
              "confidenceThreshold": 0.032954127,
              "recall": 0.16541353,
              "f1Score": 0.11488251
            },
            {
              "precision": 0.08835341,
              "confidenceThreshold": 0.035069585,
              "recall": 0.16541353,
              "f1Score": 0.11518325
            },
            {
              "precision": 0.088709675,
              "recall": 0.16541353,
              "confidenceThreshold": 0.036181003,
              "f1Score": 0.115485564
            },
            {
              "recall": 0.16541353,
              "f1Score": 0.11578947,
              "confidenceThreshold": 0.037186295,
              "precision": 0.08906882
            },
            {
              "recall": 0.16541353,
              "precision": 0.08943089,
              "confidenceThreshold": 0.038205147,
              "f1Score": 0.116094984
            },
            
            # REMOVED FOR BREVITY
            {
              "recall": 0.007518797,
              "precision": 1.0,
              "confidenceThreshold": 0.66486305,
              "f1Score": 0.014925373
            },
            {
              "precision": 1.0,
              "confidenceThreshold": 1.0
            }
          ]
        }
      ],
      "boundingBoxMeanAveragePrecision": 0.34263912
    },
    "createTime": "2021-03-10T14:18:31.880535Z",
    "sliceDimensions": [
      "annotationSpec"
    ]
  }
]

Call

In [ ]:
request = clients["model"].get_model_evaluation(name=evaluation_slice)

Response

In [ ]:
print(MessageToJson(request.__dict__["_pb"]))

Example output:

{
  "name": "projects/116273516712/locations/us-central1/models/6125898247828406272/evaluations/305090287452028928",
  "metricsSchemaUri": "gs://google-cloud-aiplatform/schema/modelevaluation/video_object_tracking_metrics_1.0.0.yaml",
  "metrics": {
    "boundingBoxMetrics": [
      {
        "confidenceMetrics": [
          {
            "recall": 1.0,
            "precision": 0.36842105,
            "f1Score": 0.53846157
          },
          {
            "recall": 0.16541353,
            "precision": 0.088,
            "f1Score": 0.11488251,
            "confidenceThreshold": 0.032954127
          },
          
          # REMOVED FOR BREVITY
          
          {
            "confidenceThreshold": 1.0,
            "precision": 1.0
          }
        ],
        "meanAveragePrecision": 0.34263912,
        "iouThreshold": 0.5
      }
    ],
    "boundingBoxMeanAveragePrecision": 0.34263912
  },
  "createTime": "2021-03-10T14:18:31.880535Z",
  "sliceDimensions": [
    "annotationSpec"
  ]
}

Make batch predictions

Prepare batch prediction data

In [ ]:
test_items = ! gcloud storage cat $IMPORT_FILE | head -n25

cols_1 = test_items[0].split(",")
cols_2 = test_items[-1].split(",")

if len(cols_1) > 12:
    test_item_1 = str(cols_1[1])
    test_item_2 = str(cols_2[1])
    test_label_1 = str(cols_1[5:])
    test_label_2 = str(cols_2[5:])
else:
    test_item_1 = str(cols_1[0])
    test_item_2 = str(cols_2[0])
    test_label_1 = str(cols_1[4:])
    test_label_2 = str(cols_2[4:])


print(test_item_1, test_label_1)
print(test_item_2, test_label_2)

Example output:

gs://automl-video-demo-data/traffic_videos/highway_005.mp4 ['0.509205', '0.594283', '', '', '0.728737', '0.760959', '', '']
gs://automl-video-demo-data/traffic_videos/highway_006.mp4 ['0.621857', '0.561570', '', '', '0.825726', '0.699151', '', '']

Make the batch input file

Let's now make a batch input file, which you store in your local Cloud Storage bucket. The batch input file can be either CSV or JSONL. You will use JSONL in this tutorial. For JSONL file, you make one dictionary entry per line for each video. The dictionary contains the key/value pairs:

  • content: The Cloud Storage path to the video.
  • mimeType: The content type. In our example, it is an avi file.
  • timeSegmentStart: The start timestamp in the video to do prediction on. Note, the timestamp must be specified as a string and followed by s (second), m (minute) or h (hour).
  • timeSegmentEnd: The end timestamp in the video to do prediction on.
In [ ]:
import json

import tensorflow as tf

gcs_input_uri = "gs://" + BUCKET_NAME + "/test.jsonl"
with tf.io.gfile.GFile(gcs_input_uri, "w") as f:
    data = {
        "content": test_item_1,
        "mimeType": "video/avi",
        "timeSegmentStart": "0.0s",
        "timeSegmentEnd": "inf",
    }
    f.write(json.dumps(data) + "\n")
    data = {
        "content": test_item_2,
        "mimeType": "video/avi",
        "timeSegmentStart": "0.0s",
        "timeSegmentEnd": "inf",
    }
    f.write(json.dumps(data) + "\n")

print(gcs_input_uri)
!gcloud storage cat $gcs_input_uri

Example output:

gs://migration-ucaip-trainingaip-20210310013516/test.jsonl
{"content": "gs://automl-video-demo-data/traffic_videos/highway_005.mp4", "mimeType": "video/avi", "timeSegmentStart": "0.0s", "timeSegmentEnd": "inf"}
{"content": "gs://automl-video-demo-data/traffic_videos/highway_006.mp4", "mimeType": "video/avi", "timeSegmentStart": "0.0s", "timeSegmentEnd": "inf"}

Request

In [ ]:
batch_prediction_job = {
    "display_name": "traffic_" + TIMESTAMP,
    # Format: 'projects/{project}/locations/{location}/models/{model_id}'
    "model": model_id,
    "model_parameters": json_format.ParseDict(
        {"confidenceThreshold": 0.5, "maxPredictions": 2}, Value()
    ),
    "input_config": {
        "instances_format": "jsonl",
        "gcs_source": {"uris": [gcs_input_uri]},
    },
    "output_config": {
        "predictions_format": "jsonl",
        "gcs_destination": {
            "output_uri_prefix": "gs://" + f"{BUCKET_NAME}/batch_output/"
        },
    },
    "dedicated_resources": {
        "machine_spec": {"machine_type": "n1-standard-4", "accelerator_count": 0},
        "starting_replica_count": 1,
        "max_replica_count": 1,
    },
}

print(
    MessageToJson(
        aip.CreateBatchPredictionJobRequest(
            parent=PARENT, batch_prediction_job=batch_prediction_job
        ).__dict__["_pb"]
    )
)

Example output:

{
  "parent": "projects/migration-ucaip-training/locations/us-central1",
  "batchPredictionJob": {
    "displayName": "traffic_20210310013516",
    "model": "projects/116273516712/locations/us-central1/models/6125898247828406272",
    "inputConfig": {
      "instancesFormat": "jsonl",
      "gcsSource": {
        "uris": [
          "gs://migration-ucaip-trainingaip-20210310013516/test.jsonl"
        ]
      }
    },
    "modelParameters": {
      "maxPredictions": 2.0,
      "confidenceThreshold": 0.5
    },
    "outputConfig": {
      "predictionsFormat": "jsonl",
      "gcsDestination": {
        "outputUriPrefix": "gs://migration-ucaip-trainingaip-20210310013516/batch_output/"
      }
    },
    "dedicatedResources": {
      "machineSpec": {
        "machineType": "n1-standard-4"
      },
      "startingReplicaCount": 1,
      "maxReplicaCount": 1
    }
  }
}

Call

Warning:
Output truncated. This notebook contains too many cells to display efficiently.