Gemini Enterprise Agent Platform Vision は、動画 データの取り込み、分析、保存に使用できる AI を活用したプラットフォームです。Gemini Enterprise Agent Platform Vision を使用すると、AI アプリケーションを構築してデプロイできます。Gemini Enterprise Agent Platform Vision と他のプロダクト コンポーネントとの統合を活用して、エンドツーエンドの Gemini Enterprise Agent Platform Vision ソリューションを構築できます。
Gemini Enterprise Agent Platform Vision プラットフォームを使用してソリューションの実装を開始するには、次の Agent Platform Vision のコンセプトとコンポーネントを確認してください。
ストリーム: ソリューションの動画ストリーミング レイヤを表します。ストリーム ソースは、ライブ動画(IP カメラなど)または動画ファイル(MP4 ファイルなど)にできます。
アプリケーション: ストリームと AI プロセッサ間の接続を有効にして、動画に対して ML オペレーションを実行します。たとえば、カメラ ストリームを、カメラの前を通過する人数をカウントする AI モデルに接続できます。
アプリの出力先: 分析されたデータをストレージの宛先(Gemini Enterprise Agent Platform Vision の Media Warehouse または BigQuery)に送信するか、ライブデータを受信します。Gemini Enterprise Agent Platform Vision のメディア ウェアハウスに保存すると、取り込まれたストリームのデータで使用される AI プロセッサから分析出力とメタデータを検索できます。BigQuery に保存すると、プロダクトのオフライン分析機能を使用できます。アプリの出力を直接受け取っている場合は、分析情報を使用してビジネス上の意思決定を即座に行うことができます。詳細については、概要: アプリの出力をデータ接続に接続するをご覧ください。
目標
このチュートリアルでは、次の方法を説明します。
- BigQuery データセットとテーブルを作成する。
- BigQuery に接続する Gemini Enterprise Agent Platform Vision 占有率分析アプリを構築する。
- Compute Engine VM インスタンスを作成し、その環境を設定します。
- VM インスタンスからアプリに動画をストリーミングします。
- 保存されたアプリの出力を使用して、BigQuery ML で予測モデルを作成します。
費用
このドキュメントでは、課金対象である次の Google Cloudコンポーネントを使用します。
- Agent Platform Vision (Streams - Data ingested, Streams - Data consumed, Models - Occupancy analytics suite)
- Compute Engine
- BigQuery
料金計算ツールを使うと、予想使用量に基づいて費用の見積もりを生成できます。
このドキュメントに記載されているタスクの完了後、作成したリソースを削除すると、それ以上の請求は発生しません。詳細については、クリーンアップをご覧ください。
始める前に
- Google Cloud アカウントにログインします。 Google Cloudを初めて使用する場合は、 アカウントを作成して、実際のシナリオでの Google プロダクトのパフォーマンスを評価してください。新規のお客様には、ワークロードの実行、テスト、デプロイができる無料クレジット $300 分を差し上げます。
-
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the BigQuery, Compute Engine and Vision AI APIs.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
Create a service account:
-
Ensure that you have the Create Service Accounts IAM role
(
roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles. -
In the Google Cloud console, go to the Create service account page.
Go to Create service account - Select your project.
-
In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.
In the Service account description field, enter a description. For example,
Service account for quickstart. - Click Create and continue.
-
Grant the following roles to the service account: Vision AI > Vision AI Editor, Compute Engine > Compute Instance Admin (beta), BigQuery > BigQuery Data Owner, Storage > Storage Object Viewer†.
To grant a role, find the Select a role list, then select the role.
To grant additional roles, click Add another role and add each additional role.
- Click Continue.
-
Click Done to finish creating the service account.
Do not close your browser window. You will use it in the next step.
-
Ensure that you have the Create Service Accounts IAM role
(
-
Create a service account key:
- In the Google Cloud console, click the email address for the service account that you created.
- Click Keys.
- Click Add key, and then click Create new key.
- Click Create. A JSON key file is downloaded to your computer.
- Click Close.
-
Google Cloud CLI をインストールします。
-
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
-
gcloud CLI を初期化するには、次のコマンドを実行します。
gcloud init -
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the BigQuery, Compute Engine and Vision AI APIs.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
Create a service account:
-
Ensure that you have the Create Service Accounts IAM role
(
roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles. -
In the Google Cloud console, go to the Create service account page.
Go to Create service account - Select your project.
-
In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.
In the Service account description field, enter a description. For example,
Service account for quickstart. - Click Create and continue.
-
Grant the following roles to the service account: Vision AI > Vision AI Editor, Compute Engine > Compute Instance Admin (beta), BigQuery > BigQuery Data Owner, Storage > Storage Object Viewer†.
To grant a role, find the Select a role list, then select the role.
To grant additional roles, click Add another role and add each additional role.
- Click Continue.
-
Click Done to finish creating the service account.
Do not close your browser window. You will use it in the next step.
-
Ensure that you have the Create Service Accounts IAM role
(
-
Create a service account key:
- In the Google Cloud console, click the email address for the service account that you created.
- Click Keys.
- Click Add key, and then click Create new key.
- Click Create. A JSON key file is downloaded to your computer.
- Click Close.
-
Google Cloud CLI をインストールします。
-
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
-
gcloud CLI を初期化するには、次のコマンドを実行します。
gcloud init
† Cloud Storage バケットからサンプル動画ファイルをコピーする場合にのみ必要なロール。
データを受信するように BigQuery を設定する
分析アプリのアプリデータからデータを受信して予測を行うには、処理された情報と一致する BigQuery データセットとテーブルを作成する必要があります。
データセットを作成する
BigQuery テーブルを作成する前に、アプリから分析された情報を受け取るためのデータセットを作成する必要があります。
コンソール
Google Cloud コンソールで [BigQuery] ページを開きます。
[エクスプローラ] パネルで、データセットを作成するプロジェクトを選択します。
アクション オプションを開いて、[データセットを作成] をクリックします。
[データセットを作成] ページで次の操作を行います。
- [データセット ID] に「
occupancy_dataset」と入力します。 [データのロケーション] で、データセットの地理的位置を選択します。データセットの作成後はロケーションを変更できません。
[デフォルトのテーブルの有効期限] で、以下のいずれかのオプションを選択します。
- 無期限: (デフォルト)データセット内に作成されたテーブルが自動的に削除されることはありません。テーブルを削除する場合は、手動で削除する必要があります。
テーブル作成後の日数: この値は、データセット内に新しく作成されたテーブルがいつ削除されるかを決定します。この値が適用されるのは、テーブルの作成時にテーブルの有効期限を設定しなかった場合です。
[データセットを作成] をクリックします。
- [データセット ID] に「
BigQuery テーブルを作成する
コンソール
Google Cloud コンソールで、[BigQuery] ページに移動します。
- [エクスプローラ] ペインでプロジェクトを開き、
occupancy_datasetデータセットを選択します。 - [データセット情報] セクションで、[ テーブルを作成] をクリックします。
- [テーブルを作成] パネルで、次の詳細を指定します。
- [ソース] セクションの [テーブルの作成元] リストで [空のテーブル] を選択します。
- [宛先] セクションで、次の詳細を指定します。
- [データセット] フィールドに
occupancy_datasetが指定されていることを確認します。 - [テーブル] フィールドに「
occupancy_dataset_table」と入力します。 - [テーブルタイプ] フィールドが [ネイティブ テーブル] に設定されていることを確認します。
- [データセット] フィールドに
- [スキーマ] セクションでスキーマ定義を入力します。スキーマ情報は、次の手順で手動で入力できます。
-
テキストとして編集] をクリックし、次の JSON 配列スキーマを貼り付けます。JSON 配列を使用する場合は、JSON スキーマ ファイルの作成と同じプロセスを使用してスキーマを生成します。
[
-
テキストとして編集] をクリックし、次の JSON 配列スキーマを貼り付けます。JSON 配列を使用する場合は、JSON スキーマ ファイルの作成と同じプロセスを使用してスキーマを生成します。