動画理解

Gemini Robotics ER 2 は、次の 2 つの機能を使用して、連続する動画フィードからタスクの進捗状況を追跡できます。

  • モーメント検出: キーイベントが発生する正確なタイムスタンプを特定します。
  • 進捗状況の分類: 各動画を 5 つの完了ブラケット(0 ~ 20%、20 ~ 40%、40 ~ 60%、60 ~ 80%、80 ~ 100%)のいずれかに割り当てます。

モーメント検出

モーメント検出では、重要なイベントが発生する正確な動画フレームを特定します(カップがいっぱいになったときや、結び目が結ばれたときなど)。ロボットはこれを使用して、成功の確認、ステップの順序付け、修正のトリガーを行います。

次のプロンプトの例では、動画内の特定のタスクの完了モーメントを特定するようにモデルに指示しています。

from google import genai

client = genai.Client()

uploaded_file = client.files.upload(file="task_video.mp4")

prompt = """
At what timestamp (in seconds) does the task reach successful completion?
Return a JSON object: {"completion_time_seconds": <float>}.
If the task is not completed, return {"completion_time_seconds": null}.
"""

interaction = client.interactions.create(
    model="gemini-robotics-er-2-preview",
    input=[
        {
            "type": "video",
            "uri": uploaded_file.uri,
            "mime_type": uploaded_file.mime_type
        },
        {"type": "text", "text": prompt}
    ],
)

print(interaction.output_text)

モーメント検出動画のフレームの例を次に示します。モデルはタスク完了のタイムスタンプを特定しています。

タイムスタンプ オーバーレイ付きのモーメント検出出力が表示された動画フレームの例

進捗状況の分類

進捗状況の分類では、動画を 5 つの完了ブラケット(0 ~ 20%、20 ~ 40%、40 ~ 60%、60 ~ 80%、80 ~ 100%)のいずれかに割り当てます。これにより、ロボットはリアルタイムで状況を把握できるため、ワークフロー全体を再起動することなく、アクションの調整や失敗したステップの再試行を行うことができます。

次のプロンプトの例では、動画から現在の進捗状況を分類するようにモデルに指示しています。

from google import genai

client = genai.Client()

uploaded_file = client.files.upload(file="task_video.mp4")

prompt = """
Watch this video and classify the task progress level at the final frame.
Return a JSON object with the progress bracket:
{"progress_level": "0-20" | "20-40" | "40-60" | "60-80" | "80-100"}.
"""

interaction = client.interactions.create(
    model="gemini-robotics-er-2-preview",
    input=[
        {
            "type": "video",
            "uri": uploaded_file.uri,
            "mime_type": uploaded_file.mime_type
        },
        {"type": "text", "text": prompt}
    ],
)

print(interaction.output_text)

進捗状況の分類動画のフレームの例を次に示します。モデルは進捗状況のブラケットを割り当てています。

進行状況の分類出力と進行状況の範囲ラベルを示す動画フレームの例

複数ステップのタスク トラッキングなど、実行可能な完全な例については、 ロボット工学のクックブックをご覧ください。

次のステップ