准备工作

要使用 AutoML Video,您必须先为您的项目启用 AutoML Video。

设置项目

  1. 登录您的 Google Cloud 账号。如果您是 Google Cloud 新手,请创建一个账号来评估我们的产品在实际场景中的表现。新客户还可获享 $300 赠金,用于运行、测试和部署工作负载。
  2. Install the Google Cloud CLI.
  3. To initialize the gcloud CLI, run the following command:

    gcloud init
  4. Create or select a Google Cloud project.

    • Create a Google Cloud project:

      gcloud projects create PROJECT_ID

      Replace PROJECT_ID with a name for the Google Cloud project you are creating.

    • Select the Google Cloud project that you created:

      gcloud config set project PROJECT_ID

      Replace PROJECT_ID with your Google Cloud project name.

  5. 确保您的 Google Cloud 项目已启用结算功能

  6. Enable the AutoML and Cloud Storage APIs:

    gcloud services enable storage-component.googleapis.com automl.googleapis.com storage-api.googleapis.com
  7. Install the Google Cloud CLI.
  8. To initialize the gcloud CLI, run the following command:

    gcloud init
  9. Create or select a Google Cloud project.

    • Create a Google Cloud project:

      gcloud projects create PROJECT_ID

      Replace PROJECT_ID with a name for the Google Cloud project you are creating.

    • Select the Google Cloud project that you created:

      gcloud config set project PROJECT_ID

      Replace PROJECT_ID with your Google Cloud project name.

  10. 确保您的 Google Cloud 项目已启用结算功能

  11. Enable the AutoML and Cloud Storage APIs:

    gcloud services enable storage-component.googleapis.com automl.googleapis.com storage-api.googleapis.com
  12. PROJECT_ID 环境变量设置为项目 ID
    export PROJECT_ID=PROJECT_ID
    AutoML API 调用和资源名称中包含您的项目 ID。PROJECT_ID 环境变量提供了一种指定此 ID 的便捷方式。

创建 Cloud Storage 存储桶

创建一个 Google Cloud Storage 存储桶以存储您的视频和输入 CSV 文件:

gsutil mb -p project-id -c regional -l us-central1 gs://your-bucket-name/