AI Platform Data Labeling Service を使用するには、事前にプロジェクトでこのサービスを有効にしておく必要があります。
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Data Labeling API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles. -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Data Labeling API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles. - Google Cloud CLI と Google Cloud CLI をインストールします。
- 手順に沿ってサービス アカウントを作成し、キーファイルをダウンロードします。
- 環境変数
GOOGLE_APPLICATION_CREDENTIALS
を、サービス アカウントの作成時にダウンロードしたサービス アカウント キーファイルのパスに設定します。export GOOGLE_APPLICATION_CREDENTIALS=KEY_FILE
- 環境変数
PROJECT_ID
をプロジェクト ID に設定します。 Data Labeling API の呼び出しとリソース名にはプロジェクト ID が含まれています。環境変数export PROJECT_ID=YOUR_PROJECT_ID
PROJECT_ID
は、ID の指定に便利です。 - ユーザー アカウントとサービス アカウントをデータラベル付け編集者の IAM ロールに追加します。
- YOUR_USERID@YOUR_DOMAIN は、ユーザー アカウントに置き換えます。
- SERVICE_ACCOUNT_NAME は、新しいサービス アカウントの名前(
service-account1@myproject.iam.gserviceaccount.com
など)に置き換えます。
gcloud auth login gcloud projects add-iam-policy-binding $PROJECT_ID
--member="user:YOUR_USERID@YOUR_DOMAIN"
--role="roles/datalabeling.editor" gcloud projects add-iam-policy-binding $PROJECT_ID
--member="serviceAccount:SERVICE_ACCOUNT_EMAIL"
--role="roles/datalabeling.editor" - ラベルを付けるデータと、ラベル付担当者への指示を保存する Google Cloud Storage バケットを作成します。