Gemini Robotics ER 2 は、次の 2 つの機能を使用して、継続的な動画フィードからタスクの進行状況を追跡できます。
- モーメントの特定: キーイベントが発生した正確なタイムスタンプを特定します。
- 進行状況の分類: 各動画を 5 つの完了ブラケット(0 ~ 20%、20 ~ 40%、40 ~ 60%、60 ~ 80%、80 ~ 100%)のいずれかに割り当てます。
モーメントの検出
モーメント検出では、カップが満杯になったときや結び目ができたときなど、重要なイベントが発生した正確な動画フレームを特定します。ロボットはこれを使用して、成功の確認、ステップの順序付け、修正のトリガーを行います。
次のプロンプトの例では、動画内の特定のタスクの完了の瞬間を特定するようモデルに指示しています。
Python
from google import genai
from google.genai import types
client = genai.Client(
enterprise=True,
project="your-project-id",
location="global",
)
with open("task_video.mp4", "rb") as f:
video_bytes = f.read()
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}.
"""
response = client.models.generate_content(
model="gemini-robotics-er-2-preview",
contents=[
types.Part.from_bytes(data=video_bytes, mime_type="video/mp4"),
prompt,
],
)
print(response.text)
次の図は、モーメント検出動画のフレームの例を示しています。モデルはタスク完了のタイムスタンプを識別しています。
進捗状況の分類
進行状況の分類では、動画が 5 つの完了率(0 ~ 20%、20 ~ 40%、40 ~ 60%、60 ~ 80%、80 ~ 100%)のいずれかに割り当てられます。これにより、ロボットはリアルタイムで状況を把握し、ワークフロー全体を再起動することなく、アクションを調整したり、失敗したステップを再試行したりできます。
次のプロンプトの例では、動画から現在の進行状況レベルを分類するようモデルに指示しています。
Python
from google import genai
from google.genai import types
client = genai.Client(
enterprise=True,
project="your-project-id",
location="global",
)
with open("task_video.mp4", "rb") as f:
video_bytes = f.read()
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"}.
"""
response = client.models.generate_content(
model="gemini-robotics-er-2-preview",
contents=[
types.Part.from_bytes(data=video_bytes, mime_type="video/mp4"),
prompt,
],
)
print(response.text)
次の例は、進捗状況分類動画のフレームを示しています。モデルは進捗状況のブラケットを割り当てています。
完全な例
マルチステップ タスク トラッキングを含む実行可能な完全な例については、ロボティクス クックブックをご覧ください。
次のステップ
Gemini Robotics ER 2 の詳細については、次のリソースをご覧ください。
- タスクのオーケストレーション: 空間推論を伴う長期的なタスク。
- 空間推論: ポインティング、トラッキング、境界ボックスの例。
- Gemini Robotics ER 2 の概要: 機能とクイックスタート。
- Gemini Robotics ER 2 モデル情報: 技術仕様、トークン制限、サポートされている機能。