ウェアハウス ストレージを使用して顔のぼかしアプリを作成する

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 モデルに接続できます。

  • メディア ウェアハウス: ストリームによって取り込まれた動画をGoogle Cloud ストレージに保存します。この宛先にデータを保存すると、取り込まれたストリームのデータで使用される AI プロセッサから分析出力とメタデータをクエリできます。

目標

このチュートリアルでは、次の方法を説明します。

  • データ入力ストリーム リソースを作成します。
  • このストリーム リソースへの動画データのストリーミングを開始します。
  • 空のアプリケーションを作成します。
  • アプリケーションにノードを追加して、データのストリーミング、データの変更、データの保存を行います。
  • アプリをデプロイして使用できるようにします。
  • Google Cloud コンソールで処理済みデータの出力を表示します。

このチュートリアルを開始する前に、Gemini Enterprise Agent Platform Vision アプリにデータを送信するストリーミング動画リソースが必要です。このリソースは、ローカル動画または RTSP フィードのいずれかになります。この動画データには、サンプルアプリでぼかし処理できる人間の顔が含まれている必要があります。

費用

このドキュメントでは、課金対象である次の Google Cloudコンポーネントを使用します。

  • Agent Platform Vision (Streams - Data ingested, Streams - Data consumed, Models - Person / face blur, Warehouse - Video storage)

料金計算ツールを使うと、予想使用量に基づいて費用の見積もりを生成できます。

新規の Google Cloud ユーザーは無料トライアルをご利用いただける場合があります。

このドキュメントに記載されているタスクの完了後、作成したリソースを削除すると、それ以上の請求は発生しません。詳細については、クリーンアップをご覧ください。

始める前に

  1. ストリーミング動画ソースの場所(ローカル(./sample_video.mp4 など)またはライブ RTSP フィードの IP アドレス(rtsp://192.168.1.180:540 など))を取得します。ストリーム リソースを作成した後、ストリームへのデータの取り込みを開始するには、この情報が必要です。
  2. Google Cloud アカウントにログインします。 Google Cloudを初めて使用する場合は、 アカウントを作成して、実際のシナリオでの Google プロダクトのパフォーマンスを評価してください。新規のお客様には、ワークロードの実行、テスト、デプロイができる無料クレジット $300 分を差し上げます。
  3. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  4. Verify that billing is enabled for your Google Cloud project.

  5. Enable the Vision AI API.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. 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.

    Enable the API

  6. Create a service account:

    1. 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.
    2. In the Google Cloud console, go to the Create service account page.

      Go to Create service account
    3. Select your project.
    4. 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.

    5. Click Create and continue.
    6. Grant the Vision AI > Vision AI Editor role to the service account.

      To grant the role, find the Select a role list, then select Vision AI > Vision AI Editor.

    7. Click Continue.
    8. Click Done to finish creating the service account.

      Do not close your browser window. You will use it in the next step.

  7. Create a service account key:

    1. In the Google Cloud console, click the email address for the service account that you created.
    2. Click Keys.
    3. Click Add key, and then click Create new key.
    4. Click Create. A JSON key file is downloaded to your computer.
    5. Click Close.
  8. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your credentials. This variable applies only to your current shell session, so if you open a new session, set the variable again.

  9. Google Cloud CLI をインストールします。

  10. 外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。

  11. gcloud CLI を初期化するには、次のコマンドを実行します。

    gcloud init
  12. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  13. Verify that billing is enabled for your Google Cloud project.

  14. Enable the Vision AI API.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. 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.

    Enable the API

  15. Create a service account:

    1. 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.
    2. In the Google Cloud console, go to the Create service account page.

      Go to Create service account